diff options
| author | Can Celik <ogulcancelik@gmail.com> | 2026-09-11 21:06:24 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-11 21:06:24 +0300 |
| commit | b11ac859c738b50ca569d9ac998d5baeeb30d33d (patch) | |
| tree | e3f71cf0370e742200c8b0eed474c72dababecbf /.github | |
| parent | 1a7c691559bb6ea8ad366bce68f87f8c3f6db098 (diff) | |
ci: reuse compiler state across validation runs (#3956)
* ci: retain zig build caches across validation runs
* ci: reduce debug information in validation builds
* ci: build only the ghostty test target for scalar checks
* ci: measure debug profiles and remove duplicate macos caching
* ci: compare scalar build scopes on one runner
* ci: keep the zig compiler path stable across runs
* ci: run macos and windows lint alongside tests
* ci: inspect remaining zig cache misses
* ci: remove completed measurement probes
* ci: compare windows linkers without changing release builds
* ci: test linux incremental reuse and correct the linker probe
* ci: measure windows incremental state reuse
* test: verify incremental reuse after a source change
* ci: finalize measured compiler cache optimizations
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/ci.yml | 78 |
1 files changed, 65 insertions, 13 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 535cd871..a481594e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,9 @@ permissions: env: RUST_TOOLCHAIN_VERSION: 1.96.1 + # Keep file/line backtraces without generating type and variable debug information. + CARGO_PROFILE_DEV_DEBUG: "1" + CARGO_PROFILE_TEST_DEBUG: "1" concurrency: group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -89,13 +92,28 @@ jobs: uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1 with: version: 0.16.0 - use-cache: ${{ matrix.kind != 'windows' }} + use-cache: ${{ runner.os == 'Linux' }} + # Linux builds both SIMD/ReleaseFast and scalar/ReleaseSafe variants. + cache-size-limit: 4096 - - name: Configure Zig cache on macOS - if: runner.os == 'macOS' + # Zig's C-header cache keys include the compiler installation path. + - name: Stabilize Zig installation path on Unix + if: matrix.kind == 'unix' + run: | + stable_zig="$RUNNER_TEMP/herdr-zig-0.16.0" + mv "$(dirname "$(command -v zig)")" "$stable_zig" + echo "$stable_zig" >> "$GITHUB_PATH" + echo "ZIG=$stable_zig/zig" >> "$GITHUB_ENV" + + - name: Stabilize Zig installation path on Windows + if: matrix.kind == 'windows' + shell: pwsh run: | - echo "ZIG_GLOBAL_CACHE_DIR=$GITHUB_WORKSPACE/.zig-cache" >> "$GITHUB_ENV" - echo "ZIG_LOCAL_CACHE_DIR=$GITHUB_WORKSPACE/.zig-cache" >> "$GITHUB_ENV" + $source = Split-Path (Get-Command zig).Source + $stable = Join-Path $env:RUNNER_TEMP "herdr-zig-0.16.0" + Move-Item -LiteralPath $source -Destination $stable + $stable | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + "ZIG=$(Join-Path $stable 'zig.exe')" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Restore Zig build cache if: runner.os == 'macOS' || matrix.kind == 'windows' @@ -106,18 +124,33 @@ jobs: restore-keys: | zig-build-v1-${{ runner.os }}-${{ runner.arch }}-0.16.0- - - name: Install macOS build tools - if: runner.os == 'macOS' - run: HOMEBREW_NO_AUTO_UPDATE=1 brew install cmake ninja - - name: Restore cargo cache uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 with: cache-bin: false key: ${{ matrix.os }} - - name: Run checks - if: matrix.kind == 'unix' + # Save before rust-cache's post-step removes incremental state. Cargo still + # rebuilds workspace targets; only rustc's validated query state is retained. + - name: Restore Windows incremental compiler state + if: matrix.kind == 'windows' + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: target/debug/incremental + key: ci-incremental-v1-${{ runner.os }}-${{ runner.arch }}-${{ env.RUST_TOOLCHAIN_VERSION }}-${{ env.CARGO_PROFILE_DEV_DEBUG }}-${{ env.CARGO_PROFILE_TEST_DEBUG }}-${{ hashFiles('Cargo.lock', 'Cargo.toml', '.cargo/config.toml', 'build.rs') }}-${{ github.sha }} + restore-keys: | + ci-incremental-v1-${{ runner.os }}-${{ runner.arch }}-${{ env.RUST_TOOLCHAIN_VERSION }}-${{ env.CARGO_PROFILE_DEV_DEBUG }}-${{ env.CARGO_PROFILE_TEST_DEBUG }}-${{ hashFiles('Cargo.lock', 'Cargo.toml', '.cargo/config.toml', 'build.rs') }}- + + - name: Run Linux lint + if: runner.os == 'Linux' + run: just lint + + - name: Run Linux tests + if: runner.os == 'Linux' + run: CARGO_INCREMENTAL=1 just ci-tests '${{ matrix.nextest_filter }}' + + - name: Run macOS checks + if: runner.os == 'macOS' run: just ci '${{ matrix.nextest_filter }}' - name: Check scalar libghostty with runtime safety @@ -125,12 +158,14 @@ jobs: env: LIBGHOSTTY_VT_SIMD: "false" LIBGHOSTTY_VT_OPTIMIZE: ReleaseSafe - run: just test-one ghostty + run: CARGO_INCREMENTAL=1 just test-one ghostty - name: Run Windows checks if: matrix.kind == 'windows' shell: pwsh - run: just check + run: | + $env:CARGO_INCREMENTAL = "1" + just check - name: Smoke ConPTY pane if: matrix.kind == 'windows' @@ -162,6 +197,23 @@ jobs: version: 0.16.0 use-cache: false + - name: Stabilize Zig installation path + shell: pwsh + run: | + $source = Split-Path (Get-Command zig).Source + $stable = Join-Path $env:RUNNER_TEMP "herdr-zig-0.16.0" + Move-Item -LiteralPath $source -Destination $stable + $stable | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + "ZIG=$(Join-Path $stable 'zig.exe')" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + - name: Restore Zig build cache + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: .zig-cache + key: zig-build-v1-conpty-package-windows-2022-${{ runner.arch }}-0.16.0-${{ github.run_id }}-${{ github.run_attempt }} + restore-keys: | + zig-build-v1-conpty-package-windows-2022-${{ runner.arch }}-0.16.0- + - name: Restore Cargo cache uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 with: |
