Repository navigation
6.1 CI Workflows
Relevant source files
The following files were used as context for generating this wiki page:
This page details the continuous integration (CI), continuous deployment (CD), and release automation infrastructure defined in the GitHub Actions workflow configurations of VariantScope. It covers the validation jobs in .github/workflows/ci.yml, the static site publishing pipeline in .github/workflows/pages.yml, and the companion release packaging sequence in .github/workflows/release.yml.
The main CI pipeline executes on every pull request and push to the main branch .github/workflows/ci.yml:3-6. It is structured with strict concurrency controls (cancel-in-progress: true) .github/workflows/ci.yml:11-13 to save runner minutes and isolates tasks into four primary jobs.
The check job runs on ubuntu-latest .github/workflows/ci.yml:18 with a 15-minute timeout .github/workflows/ci.yml:19. It performs fast static analysis, code style verification, unit testing with coverage reporting, and a production web build .github/workflows/ci.yml:27-30:
- Installs dependencies via
npm ciusing Node.js version 22 with npm caching enabled .github/workflows/ci.yml:22-26. - Executes
npm run lintandnpx prettier --check ..github/workflows/ci.yml:27-28. - Runs
npx vitest run --coverage --coverage.reporter=text-summary.github/workflows/ci.yml:29. - Compiles the web bundle via
npm run build:web.github/workflows/ci.yml:30.
To validate browser behavior against live public APIs without exceeding time limits, End-to-End (E2E) web tests are partitioned into a matrix of 4 shards running concurrently on separate runners .github/workflows/ci.yml:34-40:
- Uses
matrix.shardvalues[1, 2, 3, 4].github/workflows/ci.yml:40. - Installs Playwright Chromium binaries with system dependencies via
npx playwright install --with-deps chromium.github/workflows/ci.yml:48. - Excludes screenshot comparison specs using
--grep-invert screenshotand targets shard execution with--shard=${{ matrix.shard }}/4.github/workflows/ci.yml:50. - Automatically uploads
test-results/as an artifact if any shard fails (if: failure()) .github/workflows/ci.yml:51-56.
The package-smoke job ensures that cross-platform desktop compilation succeeds across operating systems before code is merged .github/workflows/ci.yml:58-60:
- Runs on a matrix of three operating systems:
ubuntu-latest,windows-latest, andmacos-latest.github/workflows/ci.yml:64-65. - Builds the Electron target via
npm run build:electron.github/workflows/ci.yml:74. - Executes a smoke-test packaging check using
npx electron-builder --dir --publish never.github/workflows/ci.yml:75.
The electron-e2e job executes desktop application integration tests on Linux .github/workflows/ci.yml:79-80:
- Runs under a virtual framebuffer (
xvfb-run) .github/workflows/ci.yml:101. - Adjusts Ubuntu 24.04 unprivileged user namespace restrictions (
kernel.apparmor_restrict_unprivileged_userns=0) and configureschrome-sandboxpermissions if present .github/workflows/ci.yml:91-99. - Executes Playwright tests targeting Electron (
npx playwright test --project=electron) .github/workflows/ci.yml:101. - Configured with
continue-on-error: trueas a best-effort check during initial rollout .github/workflows/ci.yml:82.
graph TD
Trigger["Push or Pull Request"] --> CheckJob["check job (ubuntu-latest)"]
Trigger --> E2EWeb["e2e-web job (matrix shard 1-4)"]
Trigger --> PackageSmoke["package-smoke job (ubuntu, windows, macos)"]
Trigger --> ElectronE2E["electron-e2e job (linux + xvfb)"]
CheckJob --> Lint["npm run lint & prettier"]
CheckJob --> Unit["vitest run --coverage"]
CheckJob --> BuildWeb["npm run build:web"]
E2EWeb --> PlaywrightWeb["playwright test --project=web"]
PackageSmoke --> BuildElectron["npm run build:electron"]
PackageSmoke --> ElectronBuilder["electron-builder --dir"]
ElectronE2E --> SandboxFix["configure userns & chrome-sandbox"]
ElectronE2E --> PlaywrightElectron["playwright test --project=electron"]
classDef default fill:#f9f9f9,stroke:#333,stroke-width:1px;
class Trigger,CheckJob,E2EWeb,PackageSmoke,ElectronE2E default;
Sources: .github/workflows/ci.yml:1-108
The web application is deployed automatically to GitHub Pages upon every push to the main branch via .github/workflows/pages.yml .github/workflows/pages.yml:1-7.
- Requires
contents: read,pages: write, andid-token: writepermissions .github/workflows/pages.yml:10-13. - Sets concurrency group to
pageswithcancel-in-progress: false.github/workflows/pages.yml:15-17.
The build job injects the correct project subpath routing required by GitHub Pages project sites (/<repository-name>/) .github/workflows/pages.yml:23-25:
- Configures environment variable
VITE_BASE: /${{ github.event.repository.name }}/.github/workflows/pages.yml:25. - Installs dependencies, runs linting, and executes unit tests (
npm test) .github/workflows/pages.yml:32-34. - Configures GitHub Pages via
actions/configure-pages@v6.github/workflows/pages.yml:35. - Builds the web distribution via
npm run build:web.github/workflows/pages.yml:36. - Validates asset path compliance by asserting that generated HTML files reference assets prefixed with
VITE_BASErather than absolute root paths .github/workflows/pages.yml:37-40:grep -q "src=\"${VITE_BASE}assets/" dist/web/index.html ! grep -E 'src="/assets/|href="/assets/' dist/web/index.html
- Uploads the resulting artifact (
dist/web) usingactions/upload-pages-artifact@v5.github/workflows/pages.yml:41-43.
- Depends on the successful completion of the
buildjob (needs: build) .github/workflows/pages.yml:46. - Deploys to the
github-pagesenvironment usingactions/deploy-pages@v5.github/workflows/pages.yml:48-53.
graph TD
PagesTrigger["Push to main branch"] --> BuildJob["build job (ubuntu-latest)"]
BuildJob --> EnvSetup["Set VITE_BASE=/repository-name/"]
EnvSetup --> TestAndBuild["npm test & npm run build:web"]
TestAndBuild --> AssetCheck["grep-q validation of index.html asset paths"]
AssetCheck --> UploadArtifact["actions/upload-pages-artifact (dist/web)"]
UploadArtifact --> DeployJob["deploy job (github-pages environment)"]
DeployJob --> ActionsDeploy["actions/deploy-pages"]
classDef default fill:#f9f9f9,stroke:#333,stroke-width:1px;
class PagesTrigger,BuildJob,DeployJob default;
Sources: .github/workflows/pages.yml:1-54
While .github/workflows/ci.yml validates commits, .github/workflows/release.yml automates desktop binary creation and publishing when release tags are pushed .github/workflows/release.yml:1-10.
- Triggers on tags matching
v*(e.g.,v0.1.0) or via manual dispatch (workflow_dispatch) .github/workflows/release.yml:6-10. - Requires
contents: writepermission to manage releases and upload assets .github/workflows/release.yml:12-13.
-
draftJob: Creates a GitHub draft release referencing the pushed tag (gh release create) prior to building, preventing race conditions among parallel builders .github/workflows/release.yml:18-30. Skipped during manual dry runs. -
buildJob: Runs acrossubuntu-latest,windows-latest, andmacos-latest.github/workflows/release.yml:35-39. It synchronizes package versioning directly from the git tag (npm version "${GITHUB_REF_NAME#v}" --no-git-tag-version --allow-same-version) .github/workflows/release.yml:50-53, executes tests (npm test) .github/workflows/release.yml:55, builds the Electron assets (npm run build:electron) .github/workflows/release.yml:56, and packs installers viaelectron-builder.github/workflows/release.yml:63. -
publishJob: Executes after all platform builds succeed .github/workflows/release.yml:75-77. It aggregates all installer artifacts, computes SHA-256 checksums intoSHA256SUMS.txt, uploads the checksum file to the draft release via the GitHub API, and flips the release draft status to published (draft=false) .github/workflows/release.yml:84-100.
graph TD
ReleaseTrigger["Tag push v* or workflow_dispatch"] --> DraftJob["draft job (Create GitHub draft release)"]
DraftJob --> BuildJobMatrix["build job matrix (ubuntu, windows, macos)"]
BuildJobMatrix --> SyncVersion["npm version sync with tag"]
SyncVersion --> RunTestsAndBuild["npm test & npm run build:electron"]
RunTestsAndBuild --> ElectronBuilderExec["npx electron-builder --publish"]
ElectronBuilderExec --> UploadInstallers["Upload installers artifact"]
UploadInstallers --> PublishJob["publish job (ubuntu-latest)"]
PublishJob --> Checksums["Compute sha256sum * > SHA256SUMS.txt"]
Checksums --> FinalizeRelease["Upload SHA256SUMS.txt & set draft=false"]
classDef default fill:#f9f9f9,stroke:#333,stroke-width:1px;
class ReleaseTrigger,DraftJob,PublishJob default;
Sources: .github/workflows/release.yml:1-100
Content imported from DeepWiki.