Skip to content

6.1 CI Workflows

coding man edited this page Nov 4, 2026 · 1 revision

CI Workflows

Relevant source files

The following files were used as context for generating this wiki page:

Purpose and Scope

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.


1. Continuous Integration Architecture (ci.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

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:

The e2e-web Shards

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:

The package-smoke Matrix

The package-smoke job ensures that cross-platform desktop compilation succeeds across operating systems before code is merged .github/workflows/ci.yml:58-60:

The electron-e2e Job

The electron-e2e job executes desktop application integration tests on Linux .github/workflows/ci.yml:79-80:

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;
Loading

Sources: .github/workflows/ci.yml:1-108


2. GitHub Pages Deployment (pages.yml)

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.

Workflow Permissions and Configuration

The build Job

The build job injects the correct project subpath routing required by GitHub Pages project sites (/<repository-name>/) .github/workflows/pages.yml:23-25:

The deploy Job

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;
Loading

Sources: .github/workflows/pages.yml:1-54


3. Release Automation Companion (release.yml)

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.

Trigger and Permissions

Pipeline Structure

  1. draft Job: 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.
  2. build Job: Runs across ubuntu-latest, windows-latest, and macos-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 via electron-builder .github/workflows/release.yml:63.
  3. publish Job: Executes after all platform builds succeed .github/workflows/release.yml:75-77. It aggregates all installer artifacts, computes SHA-256 checksums into SHA256SUMS.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;
Loading

Sources: .github/workflows/release.yml:1-100


Clone this wiki locally