Files
quiver-launcher/.github/workflows/ci.yml
T
AmazingAlekandClaude Opus 5.5 11f9979643 Keep CI's Ubuntu packages in GitHub's cache, so a slow mirror doesn't fail a run (#464)
* Keep CI's Ubuntu packages in GitHub's cache, so a slow mirror doesn't fail a run

The check, web and AppImage jobs install Ubuntu packages through a new
apt-install action. It keeps the package lists and the packages
apt-install.sh downloaded in GitHub's cache, for each runner image and list of
packages. A run that finds them there installs from them and never waits on
Ubuntu's mirror. When they aren't all it needs, it goes to the mirror as
before and keeps what it got.

The web job's WebKit libraries now go through apt-install.sh and the cache
too, with the list Playwright's install-deps would install. Before, `playwright
install --with-deps webkit` fetched about 180 packages straight from the mirror
with no retry, and stalled past its 8 minutes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Give the System libraries steps room for apt-install.sh's three tries

Its tries can take 18 minutes (three of 2 for the package lists, three of 4 for
the download), and the step stopped at 12, so a third try never finished: the
web job's first run on an empty cache stalled twice and was stopped in its
third. The steps now stop at 20, and the web job at 30.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep Ubuntu packages per release, and keep a stalled download too

The cache key named the runner's exact image, and one run's jobs got two
images (20261111.127.1 and .370.1), so the web job missed what the check job's
image had kept. It now names the Ubuntu release (ImageOS) and the packages,
and a run whose image has moved past what was kept downloads the rest.

A run that downloads saves the folder again under a key of its own, even
when the download stalled, so a mirror too slow for one run is caught up over
the next ones, and the newest save is the one restored. Packages the lists no
longer name are dropped first (apt-get autoclean), so it doesn't grow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 19:24:28 +11:00

201 lines
9.5 KiB
YAML

name: CI
on:
pull_request:
# The base branch too, so a break that lands on it shows there.
push:
branches: [main]
workflow_dispatch:
# A newer push to a pull request replaces the run for the older one.
concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
# Each job's time limit is two to three times as long as it usually takes (check 3 minutes, phone 1, windows 5,
# installer 6, appimage 5), with room for a build with nothing cached, so a stuck run stops instead of running on.
jobs:
check:
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with: { node-version: 22, cache: pnpm }
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with: { workspaces: apps/launcher/src-tauri }
# Ubuntu's mirror can crawl: the action installs from what an earlier run kept in GitHub's cache, apt-install.sh
# tries a stalled download again, and the step's limit, past the 18 minutes its tries can take, stops one that stays
# stuck rather than holding the job.
- name: System libraries
timeout-minutes: 20
uses: ./.github/actions/apt-install
with: { packages: libdbus-1-dev libwebkit2gtk-4.1-dev librsvg2-dev libayatana-appindicator3-dev libudev-dev }
- run: pnpm install --frozen-lockfile
- run: pnpm typecheck
- run: pnpm test
# The translation catalogs list every string in the code: a string added without running extract fails here.
- run: pnpm --filter @quiverlauncher/i18n check
- run: cargo test --manifest-path apps/launcher/src-tauri/Cargo.toml
# Every screen at Android phones' sizes (e2e/phone.test.js): the web side alone, so no Rust build.
phone:
runs-on: ubuntu-24.04
timeout-minutes: 12
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with: { node-version: 22, cache: pnpm }
- run: pnpm install --frozen-lockfile
# Chromium alone: the runner's image has the libraries it needs already. --with-deps added only fonts for scripts
# these English screens don't show, and Ubuntu's mirror stalled on them past the step's 8 minutes three times.
- run: pnpm --filter @quiver/e2e exec playwright install chromium
timeout-minutes: 8
- run: pnpm --filter @quiver/e2e phone
# To look over, failed or not.
- uses: actions/upload-artifact@v4
if: always()
with:
name: Phone screenshots
path: e2e/phone-screenshots/
# A controller, the keys and the mouse around every screen (e2e/web/): the web side alone in WebKit, the Rust side
# stood in for, so no Rust build and no presses waiting on a WebDriver session (about 7 minutes).
web:
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with: { node-version: 22, cache: pnpm }
- run: pnpm install --frozen-lockfile
# The libraries Playwright would install for WebKit, through the apt-install action like the other jobs' packages,
# then WebKit itself, which comes from Playwright rather than Ubuntu's mirror.
- id: webkit
run: |
packages=$(pnpm --filter @quiver/e2e exec playwright install-deps --dry-run webkit \
| sed -n 's/.*apt-get install -y --no-install-recommends \([^"&]*\).*/\1/p')
test -n "$packages"
echo "packages=--no-install-recommends $packages" >> "$GITHUB_OUTPUT"
- name: System libraries
timeout-minutes: 20
uses: ./.github/actions/apt-install
with: { packages: "${{ steps.webkit.outputs.packages }}" }
- run: pnpm --filter @quiver/e2e exec playwright install webkit
timeout-minutes: 8
- run: pnpm --filter @quiver/e2e web
windows:
runs-on: windows-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with: { node-version: 22, cache: pnpm }
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with: { workspaces: apps/launcher/src-tauri }
- run: pnpm install --frozen-lockfile
- run: cargo test --manifest-path apps/launcher/src-tauri/Cargo.toml
- run: pnpm --filter @quiver/launcher tauri build --debug --no-bundle
- name: The app starts
run: |
$env:QUIVER_DATA = "$env:RUNNER_TEMP\quiver-smoke"
$app = Start-Process apps\launcher\src-tauri\target\debug\quiver-launcher.exe -PassThru
Start-Sleep 10
"still running: $(-not $app.HasExited), exit code: $($app.ExitCode)"
Get-Content "$env:QUIVER_DATA\quiver.log" -ErrorAction SilentlyContinue
Stop-Process $app -ErrorAction SilentlyContinue
installer:
runs-on: windows-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with: { node-version: 22, cache: pnpm }
- uses: dtolnay/rust-toolchain@stable
# Shared with the release workflow's Windows build, which starts from it.
- uses: Swatinem/rust-cache@v2
with: { workspaces: apps/launcher/src-tauri, shared-key: windows-release }
- run: pnpm install --frozen-lockfile
# Unsigned until there are signing keys.
- run: pnpm --filter @quiver/launcher tauri build --bundles nsis
# Usage data and error reports (telemetry.ts), as in a release.
env:
VITE_USAGE_DATA: "1"
VITE_SENTRY_DSN: https://84d1ea0079a275f2356a6605b1823ff5@o4512369991942144.ingest.de.sentry.io/4512370215551056
- uses: actions/upload-artifact@v4
with:
name: Quiver Launcher Windows installer
path: apps/launcher/src-tauri/target/release/bundle/nsis/*.exe
# For Linux and Steam Deck: runs without installing anything. Built on the
# oldest supported Ubuntu so it works on older and newer distros alike, on
# Chromium (Tauri's CEF runtime) as the release is.
appimage:
runs-on: ubuntu-22.04
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with: { node-version: 22, cache: pnpm }
- uses: dtolnay/rust-toolchain@stable
# Kept when a later step fails too: a build from nothing takes about 20 minutes, and a run that fails after it
# would otherwise leave the next one to start from nothing again.
- uses: Swatinem/rust-cache@v2
with: { workspaces: apps/launcher/src-tauri, key: cef, cache-on-failure: true }
# The CEF build's CLI (built once per revision in cef-tools.sh) and the CEF distribution, saved as soon as each is
# there, whatever happens after.
- id: cef
run: echo "rev=$(sed -n 's/^REV=//p' .github/cef-tools.sh)" >> "$GITHUB_OUTPUT"
- id: cli
uses: actions/cache/restore@v4
with: { path: ~/.cache/tauri-cef-cli, key: "tauri-cef-cli-${{ steps.cef.outputs.rev }}" }
- id: dist
uses: actions/cache/restore@v4
with: { path: ~/.cache/cef, key: "cef-${{ hashFiles('apps/launcher/src-tauri/Cargo.cef.lock') }}" }
# Ubuntu's mirror can crawl: the action installs from what an earlier run kept in GitHub's cache, apt-install.sh
# tries a stalled download again, and the step's limit, past the 18 minutes its tries can take, stops one that stays
# stuck rather than holding the job.
- name: System libraries
timeout-minutes: 20
uses: ./.github/actions/apt-install
with: { packages: libdbus-1-dev libwebkit2gtk-4.1-dev librsvg2-dev libayatana-appindicator3-dev libudev-dev libfuse2 xvfb }
- name: The CEF build's tools
timeout-minutes: 25
run: .github/cef-tools.sh
- if: steps.cli.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with: { path: ~/.cache/tauri-cef-cli, key: "${{ steps.cli.outputs.cache-primary-key }}" }
- run: pnpm install --frozen-lockfile
- run: sh apps/launcher/scripts/tauri-cef.sh build --bundles appimage
env:
VITE_USAGE_DATA: "1"
VITE_SENTRY_DSN: https://84d1ea0079a275f2356a6605b1823ff5@o4512369991942144.ingest.de.sentry.io/4512370215551056
- if: always() && steps.dist.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with: { path: ~/.cache/cef, key: "${{ steps.dist.outputs.cache-primary-key }}" }
- name: The AppImage holds what Chromium loads
run: .github/cef-appimage-check.sh apps/launcher/src-tauri/target/release/bundle/appimage/*.AppImage
- name: The AppImage starts
run: |
export QUIVER_DATA=$RUNNER_TEMP/quiver-smoke
# A smoke test isn't usage: its events go nowhere.
export QUIVER_USAGE_HOST=http://127.0.0.1:9
# Output goes to a file so nothing left running holds the step open.
status=0; xvfb-run -a timeout 15 apps/launcher/src-tauri/target/release/bundle/appimage/*.AppImage > $RUNNER_TEMP/app.log 2>&1 || status=$?
cat $RUNNER_TEMP/app.log $QUIVER_DATA/quiver.log 2>/dev/null || true
# 124: still running when the timeout stopped it.
test $status -eq 124
- uses: actions/upload-artifact@v4
with:
name: Quiver Launcher for Linux (AppImage)
path: apps/launcher/src-tauri/target/release/bundle/appimage/*.AppImage