Files
backrest/.github/workflows/test.yml
T
dependabot[bot] efb2ab3955
Test / test-nix (push) Has been cancelled
Test / test-webui (push) Has been cancelled
Test / test-e2e-web (push) Has been cancelled
Test / test-win (push) Has been cancelled
chore(deps): bump the actions group across 1 directory with 14 updates
Bumps the actions group with 14 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [actions/checkout](https://github.com/actions/checkout) | `3` | `7` |
| [actions/setup-node](https://github.com/actions/setup-node) | `4` | `6` |
| [actions/upload-pages-artifact](https://github.com/actions/upload-pages-artifact) | `3` | `5` |
| [actions/deploy-pages](https://github.com/actions/deploy-pages) | `4` | `5` |
| [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) | `3` | `4` |
| [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) | `3` | `4` |
| [actions/setup-go](https://github.com/actions/setup-go) | `4` | `6` |
| [pnpm/action-setup](https://github.com/pnpm/action-setup) | `4` | `6` |
| [docker/login-action](https://github.com/docker/login-action) | `3` | `4` |
| [actions/upload-artifact](https://github.com/actions/upload-artifact) | `4` | `7` |
| [actions/download-artifact](https://github.com/actions/download-artifact) | `4` | `8` |
| [softprops/action-gh-release](https://github.com/softprops/action-gh-release) | `2` | `3` |
| [actions/cache](https://github.com/actions/cache) | `3` | `6` |
| [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) | `7` | `8` |



Updates `actions/checkout` from 3 to 7
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v7)

Updates `actions/setup-node` from 4 to 6
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v4...v6)

Updates `actions/upload-pages-artifact` from 3 to 5
- [Release notes](https://github.com/actions/upload-pages-artifact/releases)
- [Commits](https://github.com/actions/upload-pages-artifact/compare/v3...v5)

Updates `actions/deploy-pages` from 4 to 5
- [Release notes](https://github.com/actions/deploy-pages/releases)
- [Commits](https://github.com/actions/deploy-pages/compare/v4...v5)

Updates `docker/setup-qemu-action` from 3 to 4
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](https://github.com/docker/setup-qemu-action/compare/v3...v4)

Updates `docker/setup-buildx-action` from 3 to 4
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v3...v4)

Updates `actions/setup-go` from 4 to 6
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v4...v6)

Updates `pnpm/action-setup` from 4 to 6
- [Release notes](https://github.com/pnpm/action-setup/releases)
- [Commits](https://github.com/pnpm/action-setup/compare/v4...v6)

Updates `docker/login-action` from 3 to 4
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v3...v4)

Updates `actions/upload-artifact` from 4 to 7
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v7)

Updates `actions/download-artifact` from 4 to 8
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4...v8)

Updates `softprops/action-gh-release` from 2 to 3
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2...v3)

Updates `actions/cache` from 3 to 6
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3...v6)

Updates `peter-evans/create-pull-request` from 7 to 8
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](https://github.com/peter-evans/create-pull-request/compare/v7...v8)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/deploy-pages
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/download-artifact
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/setup-go
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/setup-node
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/upload-pages-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: docker/login-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: docker/setup-buildx-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: docker/setup-qemu-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: peter-evans/create-pull-request
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: pnpm/action-setup
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: softprops/action-gh-release
  dependency-version: '3'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-10 09:55:56 +00:00

224 lines
6.3 KiB
YAML

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Test
on:
push:
paths-ignore:
- "docs/**"
- "*.md"
pull_request:
paths-ignore:
- "docs/**"
- "*.md"
workflow_dispatch:
jobs:
test-nix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.24"
- name: Install gotestsum
run: go install gotest.tools/gotestsum@latest
- name: Create Fake WebUI Sources
run: |
mkdir -p webui/dist
# Create an empty gzip file for testing
gzip -c /dev/null > webui/dist/index.html.gz
- name: Build
run: go build ./...
- name: Test
run: PATH=$(pwd):$PATH gotestsum ./... -- --race
test-webui:
runs-on: ubuntu-latest
env:
TZ: UTC
steps:
- uses: actions/checkout@v7
- name: Setup pnpm
uses: pnpm/action-setup@v6
with:
version: 9
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: "20"
cache: pnpm
cache-dependency-path: webui/pnpm-lock.yaml
- name: Install dependencies
run: cd webui && pnpm install --frozen-lockfile
# Runs compile-i18n (paraglide) first, then vitest.
- name: Test
run: cd webui && pnpm test
- name: Typecheck
run: cd webui && pnpm run check
test-e2e-web:
runs-on: ubuntu-latest
env:
# Not RCLONE_*: rclone reads RCLONE_VERSION as its --version flag.
E2E_RCLONE_VERSION: v1.69.1
steps:
- uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.24"
- name: Setup pnpm
uses: pnpm/action-setup@v6
with:
version: 9
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: "20"
cache: pnpm
cache-dependency-path: webui/pnpm-lock.yaml
- name: Install dependencies
run: cd webui && pnpm install --frozen-lockfile
- name: Build WebUI
run: cd webui && pnpm run build
- name: Build backrest binary (embeds the real WebUI)
run: |
mkdir -p webui/e2e/.cache
go build -o webui/e2e/.cache/backrest ./cmd/backrest
# Keyed on the file that pins RequiredResticVersion; global-setup
# provisions restic into this directory on a cache miss.
- name: Cache restic
uses: actions/cache@v6
with:
path: webui/e2e/.cache/restic-data
key: restic-e2e-${{ hashFiles('internal/resticinstaller/resticinstaller.go') }}
- name: Cache playwright browsers
uses: actions/cache@v6
with:
path: ~/.cache/ms-playwright
key: playwright-${{ hashFiles('webui/pnpm-lock.yaml') }}
- name: Install playwright chromium
run: cd webui && pnpm exec playwright install --with-deps chromium
# restic's rclone backend spawns the `rclone` binary; the rclone-repo
# e2e spec skips itself if rclone is absent, so provision it for coverage.
- name: Cache rclone
id: cache-rclone
uses: actions/cache@v6
with:
path: webui/e2e/.cache/rclone-bin
key: rclone-${{ env.E2E_RCLONE_VERSION }}
- name: Install rclone
run: |
dest="$PWD/webui/e2e/.cache/rclone-bin"
if [ ! -x "$dest/rclone" ]; then
mkdir -p "$dest"
zip="rclone-${E2E_RCLONE_VERSION}-linux-amd64"
curl -fsSL "https://downloads.rclone.org/${E2E_RCLONE_VERSION}/${zip}.zip" -o /tmp/rclone.zip
unzip -j -o /tmp/rclone.zip "${zip}/rclone" -d "$dest"
chmod +x "$dest/rclone"
fi
echo "$dest" >> "$GITHUB_PATH"
- name: Run e2e tests
run: |
cd webui
E2E_SKIP_WEBUI_BUILD=1 E2E_BACKREST_BIN=$PWD/e2e/.cache/backrest pnpm run e2e
- name: Upload playwright report
uses: actions/upload-artifact@v7
if: failure()
with:
name: playwright-report
path: |
webui/playwright-report/
webui/test-results/
test-win:
runs-on: windows-latest
steps:
- uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.24"
- name: Create Fake WebUI Sources
run: |
New-Item -Path .\webui\dist-windows\index.html -ItemType File -Force
- name: Resolve latest restic version
shell: powershell
id: restic-version
run: |
$latest = Invoke-RestMethod -Uri "https://api.github.com/repos/restic/restic/releases/latest"
$tag = $latest.tag_name
if ($tag.StartsWith("v")) {
$tag = $tag.Substring(1)
}
echo "RESTIC_VERSION=$tag" >> $env:GITHUB_ENV
- name: Cache restic
id: cache-restic
uses: actions/cache@v6
with:
path: restic-bin
key: restic-windows-${{ env.RESTIC_VERSION }}
- name: Download restic
if: steps.cache-restic.outputs.cache-hit != 'true'
shell: powershell
run: |
$tag = $env:RESTIC_VERSION
$url = "https://github.com/restic/restic/releases/download/v$tag/restic_${tag}_windows_amd64.zip"
$output = "restic.zip"
$dest = "restic-bin"
New-Item -ItemType Directory -Force -Path $dest
Write-Host "Downloading $url..."
Invoke-WebRequest -Uri $url -OutFile $output
Expand-Archive $output -DestinationPath temp_extract -Force
$extracted = Get-ChildItem -Recurse -Path temp_extract -Filter "restic*.exe" | Select-Object -First 1
if ($extracted) {
Move-Item $extracted.FullName -Destination "$dest\restic.exe" -Force
} else {
Write-Error "Could not find restic.exe"
}
Remove-Item -Recurse -Force temp_extract
Remove-Item -Force $output
- name: Add restic to PATH
run: echo "$PWD\restic-bin" >> $env:GITHUB_PATH
- name: Build
run: go build ./...
- name: Test
run: go test ./...