From d4ff7c9331054f99c23adbd572c1d06c2a40e86e Mon Sep 17 00:00:00 2001 From: kylekz Date: Tue, 10 Nov 2026 01:07:48 +1300 Subject: [PATCH 1/2] CI: split script/check into two jobs; release reuses main's CI run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - script/check --e2e-only: step 5 alone. CI runs it on Windows and Linux as a job of its own beside --fast (--fast --linux on Linux), so the two halves together are every step. Measured on warm caches: the run's wall-clock 14.0 → 8.3 min (Windows 14 → 6 and 8.2 min, Linux 9.4 → 6 and 6.7 min). - ci.yml skips changes to documentation alone (docs/, root Markdown, tests/e2e/README.md); no gate reads them. - release.yml: when main's push run of ci.yml for the tagged commit passes, the release waits for it instead of running every gate again cold (34 min, the release's slowest path); with none, or one that doesn't pass, it runs ci.yml itself. The static musl dv is its own job, so the Windows release starts after it (~1.5 min) rather than after the AppImage (~14.6 min). PLAN §13.2, §13.4 and CLAUDE.md follow. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 59 ++++++++++++++---- .github/workflows/release.yml | 113 ++++++++++++++++++++++++++++------ CLAUDE.md | 1 + docs/PLAN.md | 39 +++++++----- script/check | 93 ++++++++++++++++------------ 5 files changed, 217 insertions(+), 88 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e79ade9..6c4d606 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,8 @@ # Every gate of script/check on GitHub's own runners (docs/PLAN.md §13.4): Windows, Linux and # macOS, plus the workflows' and the dependencies' own checks. It runs on pushes to main, on -# pull requests, and for every release tag before anything is published (release.yml calls it). +# pull requests, and for a release tag whose commit has no passing run on main (release.yml +# calls it). On Windows and Linux, script/check runs as two jobs side by side, `--fast` (steps +# 1-4, and step 6 on Linux) and `--e2e-only` (step 5), which together are its every step. # # Security: the token is read-only in every job, no job has a secret, checkouts keep no # credentials, every action is pinned to a commit, and nothing runs on pull_request_target. The @@ -10,10 +12,23 @@ name: CI +# A change to the documentation alone (docs/, the Markdown at the root, the e2e README) runs +# nothing: no gate reads them. crates/dv_cli/skill/SKILL.md is code (dv_cli embeds and tests it), +# and a release's call (workflow_call) has no path filter. on: push: branches: [main] + paths: + - "**" + - "!docs/**" + - "!*.md" + - "!tests/e2e/README.md" pull_request: + paths: + - "**" + - "!docs/**" + - "!*.md" + - "!tests/e2e/README.md" workflow_call: permissions: {} @@ -69,11 +84,15 @@ jobs: arguments: --all-features --locked windows: - name: Windows (script/check) + name: Windows (script/check ${{ matrix.check }}) runs-on: windows-2025 timeout-minutes: 75 permissions: contents: read + strategy: + fail-fast: false + matrix: + check: [--fast, --e2e-only] steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -95,6 +114,7 @@ jobs: restore-keys: windows- # The runner's desktop is 1024x768, too small for the scenarios' 1440x900 windows. - name: A 1920x1080 desktop for the e2e scenarios + if: ${{ matrix.check == '--e2e-only' }} shell: pwsh run: | Set-DisplayResolution -Width 1920 -Height 1080 -Force @@ -103,24 +123,27 @@ jobs: # The runner's own temp dir, whose name is long: the default one is spelled with an 8.3 # short name (C:\Users\RUNNER~1\…), which git and the file system report long, so tests # that compare a fixture's path with what came back would see two spellings of one folder. - - name: script/check + - name: script/check ${{ matrix.check }} shell: bash + env: + CHECK: ${{ matrix.check }} run: | export TMP="$RUNNER_TEMP" TEMP="$RUNNER_TEMP" - bash script/check + bash script/check "$CHECK" - name: The e2e scenarios' screenshots and logs - if: ${{ failure() }} + if: ${{ failure() && matrix.check == '--e2e-only' }} uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: e2e-windows path: target/e2e retention-days: 7 if-no-files-found: ignore + # The --fast half's target dir, whose dependencies the --e2e-only half's build reuses. - name: Save the cache (main, once per Cargo.lock) - if: ${{ !cancelled() && github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.cache.outputs.cache-hit != 'true' }} + if: ${{ !cancelled() && matrix.check == '--fast' && github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.cache.outputs.cache-hit != 'true' }} shell: bash run: rm -rf target/debug/incremental target/e2e target/tmp - - if: ${{ !cancelled() && github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.cache.outputs.cache-hit != 'true' }} + - if: ${{ !cancelled() && matrix.check == '--fast' && github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.cache.outputs.cache-hit != 'true' }} uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: | @@ -131,11 +154,15 @@ jobs: key: windows-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }} linux: - name: Linux (script/check --linux) + name: Linux (script/check ${{ matrix.check }}) runs-on: ubuntu-24.04 timeout-minutes: 75 permissions: contents: read + strategy: + fail-fast: false + matrix: + check: [--fast --linux, --e2e-only] steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -167,20 +194,26 @@ jobs: target key: linux-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }} restore-keys: linux- - - name: script/check --linux - run: bash script/check --linux + - name: script/check ${{ matrix.check }} + env: + CHECK: ${{ matrix.check }} + run: | + read -ra args <<< "$CHECK" + bash script/check "${args[@]}" - name: The e2e scenarios' screenshots and logs - if: ${{ failure() }} + if: ${{ failure() && matrix.check == '--e2e-only' }} uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: e2e-linux path: target/e2e retention-days: 7 if-no-files-found: ignore + # The --fast --linux half's target dirs, whose dependencies the --e2e-only half's build + # reuses, and the musl build's. - name: Save the cache (main, once per Cargo.lock) - if: ${{ !cancelled() && github.event_name == 'push' && github.ref == 'refs/heads/main' && env.ACT != 'true' && steps.cache.outputs.cache-hit != 'true' }} + if: ${{ !cancelled() && matrix.check != '--e2e-only' && github.event_name == 'push' && github.ref == 'refs/heads/main' && env.ACT != 'true' && steps.cache.outputs.cache-hit != 'true' }} run: rm -rf target/debug/incremental target/e2e target/tmp - - if: ${{ !cancelled() && github.event_name == 'push' && github.ref == 'refs/heads/main' && env.ACT != 'true' && steps.cache.outputs.cache-hit != 'true' }} + - if: ${{ !cancelled() && matrix.check != '--e2e-only' && github.event_name == 'push' && github.ref == 'refs/heads/main' && env.ACT != 'true' && steps.cache.outputs.cache-hit != 'true' }} uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 73f9484..622fab2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,9 @@ # A release (docs/PLAN.md §13.4): pushing an annotated tag `v` on a commit on main # builds the Windows and macOS releases (Setup.exe, the .pkg, and the Velopack update feed the -# installed app reads) and the Linux AppImage on GitHub's runners, runs every CI gate on that commit, and then waits for -# the owner to approve the `release` environment before anything is published to GitHub -# Releases. +# installed app reads) and the Linux AppImage on GitHub's runners, makes sure every CI gate +# passed on that commit (main's own CI run for it when that one passes, else a run of ci.yml +# here), and then waits for the owner to approve the `release` environment before anything is +# published to GitHub Releases. # # Security, beyond ci.yml's: # - only the owner can create `v*` tags, and no tag can be moved or deleted (a repository @@ -66,9 +67,56 @@ jobs: if-no-files-found: error retention-days: 7 + # The tag's commit is on main, whose push ran ci.yml on it moments before the tag: when that + # run passes, it is this commit's CI, and the release doesn't run the same gates a second + # time, cold, on the slowest path (PLAN §13.4). No run, or one that doesn't pass (failed, + # cancelled, superseded while it waited), and the `ci` job below runs them here instead. + main-ci: + name: CI on main for this commit + needs: verify + runs-on: ubuntu-24.04 + timeout-minutes: 120 + permissions: + actions: read + outputs: + passed: ${{ steps.main.outputs.passed }} + steps: + - name: Wait for main's CI run of this commit + id: main + env: + GH_TOKEN: ${{ github.token }} + SHA: ${{ github.sha }} + run: | + set -euo pipefail + # The push to main comes first, but its run can take a few seconds to be listed. + id="" + for _ in 1 2 3 4 5 6; do + id="$(gh run list --repo "$GITHUB_REPOSITORY" --workflow ci.yml --branch main \ + --event push --commit "$SHA" --limit 1 --json databaseId --jq '.[0].databaseId // ""')" + if [[ -n "$id" ]]; then break; fi + sleep 10 + done + if [[ -z "$id" ]]; then + echo "No CI run on main for $SHA: this release runs ci.yml itself" + echo "passed=false" >> "$GITHUB_OUTPUT" + exit 0 + fi + echo "main's CI run for $SHA: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$id" + gh run watch "$id" --repo "$GITHUB_REPOSITORY" --interval 60 > /dev/null + conclusion="$(gh run view "$id" --repo "$GITHUB_REPOSITORY" --json conclusion --jq .conclusion)" + echo "conclusion: $conclusion" + if [[ "$conclusion" == success ]]; then + echo "passed=true" >> "$GITHUB_OUTPUT" + else + echo "It didn't pass: this release runs ci.yml itself" + echo "passed=false" >> "$GITHUB_OUTPUT" + fi + ci: name: CI - needs: verify + needs: [verify, main-ci] + # main-ci failing to answer counts as no answer: the gates run here. + if: ${{ !cancelled() && needs.verify.result == 'success' && needs.main-ci.outputs.passed != 'true' }} # A job-level call resolves from this same commit before anything runs, so the runtime # checkout the self-repository form (`$/`) guards against can't reach it; actionlint doesn't # read `$/` yet. @@ -76,8 +124,43 @@ jobs: permissions: contents: read + # The static dv WSL distros run, which the Windows release ships beside dv.exe: a job of its + # own, so the Windows release starts once it is built rather than after the AppImage. + linux-dv: + name: Linux dv (WSL) + needs: verify + runs-on: ubuntu-24.04 + timeout-minutes: 60 + permissions: + contents: read + env: + VERSION: ${{ needs.verify.outputs.version }} + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: rustup (act's runner image has none; GitHub's has) + if: ${{ env.ACT == 'true' }} + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | + sh -s -- -y --profile minimal --default-toolchain none + echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" + - name: Rust toolchain (rust-toolchain.toml) + run: rustup toolchain install && rustc --version + - name: The static Linux dv WSL distros run (script/build-linux) + env: + DV_CHANNEL: release + DV_VERSION: ${{ env.VERSION }} + run: bash script/build-linux --profile dist --out target/package/linux + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: linux-builds + path: target/package/linux/dv-linux-x86_64 + if-no-files-found: error + retention-days: 7 + linux: - name: Linux builds + name: Linux AppImage needs: verify runs-on: ubuntu-24.04 timeout-minutes: 120 @@ -107,23 +190,12 @@ jobs: dotnet-version: 8.0.x - name: vpk 1.2.161 (the velopack crate's version) run: dotnet tool install -g vpk --version 1.2.161 - - name: The static Linux dv WSL distros run (script/build-linux) - env: - DV_CHANNEL: release - DV_VERSION: ${{ env.VERSION }} - run: bash script/build-linux --profile dist --out target/package/linux - name: The Linux app's AppImage (script/package --linux-app) run: | set -euo pipefail bash script/package --linux-app --version "$VERSION" --out target/package/linux-release mkdir -p target/package/upload cp target/package/linux-release/dv.AppImage target/package/upload/dv-linux-x86_64.AppImage - - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 - with: - name: linux-builds - path: target/package/linux/dv-linux-x86_64 - if-no-files-found: error - retention-days: 7 - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: release-linux @@ -133,7 +205,7 @@ jobs: windows: name: Windows release - needs: [verify, linux] + needs: [verify, linux-dv] runs-on: windows-2025 timeout-minutes: 120 permissions: @@ -263,7 +335,12 @@ jobs: publish: name: Publish (after the owner approves) - needs: [verify, ci, linux, windows, macos] + needs: [verify, main-ci, ci, linux-dv, linux, windows, macos] + # Every build, and the gates either on main or here (`ci` is skipped when main's run passed). + if: >- + ${{ !cancelled() && needs.verify.result == 'success' && needs.linux.result == 'success' + && needs.windows.result == 'success' && needs.macos.result == 'success' + && (needs.main-ci.outputs.passed == 'true' || needs.ci.result == 'success') }} runs-on: ubuntu-24.04 timeout-minutes: 30 environment: diff --git a/CLAUDE.md b/CLAUDE.md index 853e1ee..9a62bc3 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -153,6 +153,7 @@ and a gpui bump starts there. Don't guess APIs: grep the sources under ```bash script/check # every gate (PLAN §13.2): fmt, clippy x3, gpui boundary, tests, e2e script/check --fast # the same without the e2e scenarios +script/check --e2e-only # the e2e scenarios alone (step 5; CI's job beside --fast) script/check --foreground # also tests/e2e/foreground: takes the focus for a few seconds script/check --linux # also step 6: the headless crates and dv tested and linted in WSL # Ubuntu, script/build-linux --debug-only, the real WSL sandboxed under /tmp diff --git a/docs/PLAN.md b/docs/PLAN.md index fcdb7d0..4b9ca4b 100644 --- a/docs/PLAN.md +++ b/docs/PLAN.md @@ -2449,7 +2449,8 @@ change is committed; CI (§13.4) runs the same script on GitHub's runners once i 4. `cargo test --workspace` 5. a plain `cargo build -p dv -p mock_gh -p mock_lsp` (step 4's test build links the binaries with gpui's test support), then the e2e scenarios (`cargo run -p dv_e2e --bin e2e -- tests/e2e`), - background mode; `--fast` skips this step. `--foreground` also runs `tests/e2e/foreground/`, + background mode; `--fast` skips this step, and `--e2e-only` runs it alone (CI's second job + beside `--fast`, §13.4). `--foreground` also runs `tests/e2e/foreground/`, the scenarios that must take the focus (screen captures of the window materials, §14.2) 6. `--linux`: inside WSL Ubuntu with `CARGO_TARGET_DIR` on ext4, `cargo test -p dv_core -p dv_backend -p dv_cli -p dv_lsp -p dv_test_support -p mock_gh -p mock_lsp`, `cargo test -p dv @@ -2600,30 +2601,36 @@ owns `~/.local/bin/dv` (§5.2's link rule). ### 13.4 CI and releases (GitHub Actions) The repository is public, so GitHub's hosted runners cost nothing. Two workflows: -- **`.github/workflows/ci.yml`**, on every push to main, every pull request, and for every - release tag (`release.yml` calls it): `script/check` on Windows (`windows-2025`), - `script/check --fast` on macOS (`macos-15`, Apple silicon: its runner's 1024×768 screen is too - small for the scenarios' 1440×900 windows, which `script/check-mac` runs on the owner's Mac), - `script/check --linux` on Ubuntu 24.04 (the gates, the e2e - scenarios on the runner's own Xvfb with Mesa's software Vulkan, the headless crates and the - static musl build; the real-WSL step needs Windows with WSL and is skipped), the workflows - themselves (actionlint, and zizmor's security audits, pedantic; locally +- **`.github/workflows/ci.yml`**, on every push to main, every pull request, and for a release + tag whose commit has no passing run on main (`release.yml` calls it): `script/check` on + Windows (`windows-2025`), `script/check --fast` on macOS (`macos-15`, Apple silicon: its + runner's 1024×768 screen is too small for the scenarios' 1440×900 windows, which + `script/check-mac` runs on the owner's Mac), `script/check --linux` on Ubuntu 24.04 (the + gates, the e2e scenarios on the runner's own Xvfb with Mesa's software Vulkan, the headless + crates and the static musl build; the real-WSL step needs Windows with WSL and is skipped). + On Windows and Linux each runs as two jobs side by side, `--fast` (with `--linux` on Linux) + and `--e2e-only`, which together are every step (the scenarios take about as long as the + tests, so the two halves run at once). Beside them, the workflows themselves (actionlint, and zizmor's security audits, pedantic; locally `script/check-workflows`), and the dependencies (cargo-deny, `deny.toml`: every crate from crates.io with a license on its list, no yanked crate, no open RustSec vulnerability; one that doesn't apply is ignored there with why). A failure keeps the e2e screenshots and logs as the run's artifact for a week. The caches (Cargo's registry and the target dirs) are saved only - by a push to main. + by a push to main. A push or pull request that changes only documentation (`docs/`, the + Markdown at the root, `tests/e2e/README.md`) runs nothing, since no gate reads it. - **`.github/workflows/release.yml`**, on pushing a tag `v*`: 1. **the tag** (`script/release-check`): an annotated `v` (a prerelease such as `v0.2.0-rc.1` too) whose version without the prerelease is the tagged commit's workspace version, on a commit on main; the tag's message is the release notes; - 2. **CI** in full on that commit (ci.yml), alongside + 2. **CI** on that commit, alongside the builds: the push to main that brought the commit ran + ci.yml on it, and when that run passes (the release waits for it) it stands for this one; + with no such run, or one that doesn't pass (failed, cancelled, superseded in the queue), + the release runs ci.yml in full itself, without caches; 3. **the builds**, with no cache: the static musl `dv-linux-x86_64` (`script/build-linux - --profile dist`) and the AppImage (`script/package --linux-app`, `vpk pack` on the runner), - then the Windows release (`vpk download github` fetches the latest release's full - package, from which `vpk pack` makes the delta and against which `dv_package` checks the - version newer, then `script/package --version --feed https://github.com/ - --linux-dir … --out …`), and the macOS release on `macos-15` the same way (its channel + --profile dist`, a job of its own) and the AppImage (`script/package --linux-app`, `vpk + pack` on the runner), and once the musl build is done the Windows release (`vpk download + github` fetches the latest release's full package, from which `vpk pack` makes the delta + and against which `dv_package` checks the version newer, then `script/package --version + --feed https://github.com/ --linux-dir … --out …`), and the macOS release on `macos-15` the same way (its channel `osx`, `script/package --version --feed … --out …`); 4. **publish**, in the `release` environment, which waits for the owner's approval: the files' `SHA256SUMS`, their build provenance (`actions/attest-build-provenance`), then the diff --git a/script/check b/script/check index 27888d0..751fa7a 100755 --- a/script/check +++ b/script/check @@ -4,6 +4,8 @@ # # script/check steps 1-5 # script/check --fast steps 1-4 (skips the e2e scenarios) +# script/check --e2e-only step 5 alone: CI runs it as a job of its own beside --fast, so +# the two together are steps 1-5 (PLAN §13.4) # script/check --foreground also the foreground scenarios in tests/e2e/foreground (step 5) # script/check --linux also step 6: the headless crates and dv inside WSL Ubuntu, the # Linux build (script/build-linux) and the real WSL from Windows: @@ -17,7 +19,7 @@ set -euo pipefail usage() { cat <<'EOF' -usage: script/check [--fast] [--foreground] [--linux] [--linux-gui] +usage: script/check [--fast | --e2e-only] [--foreground] [--linux] [--linux-gui] 1. cargo fmt --all --check 2. cargo clippy in dv's three shapes: default (gui + automation), the shipped app @@ -26,6 +28,7 @@ usage: script/check [--fast] [--foreground] [--linux] [--linux-gui] 4. cargo test --workspace 5. e2e scenarios in tests/e2e through dv_e2e (background) skipped with --fast and tests/e2e/foreground (takes the focus; hands off) only with --foreground + (--e2e-only: this step alone) 6. the headless crates and the headless dv tested and linted inside WSL Ubuntu, script/build-linux, then the real WSL (sandboxed under /tmp) only with --linux 7. the Linux app inside WSL Ubuntu: clippy in its GUI shapes, the gpui crates' tests and @@ -35,12 +38,14 @@ EOF } fast=0 +e2e_only=0 foreground=0 linux=0 linux_gui=0 for arg in "$@"; do case "$arg" in --fast) fast=1 ;; + --e2e-only) e2e_only=1 ;; --foreground) foreground=1 ;; --linux) linux=1 ;; --linux-gui) linux_gui=1 ;; @@ -60,6 +65,10 @@ if [[ "$fast" -eq 1 && "$foreground" -eq 1 ]]; then echo "script/check: --fast skips the e2e step that --foreground adds to" >&2 exit 2 fi +if [[ "$e2e_only" -eq 1 && ("$fast" -eq 1 || "$linux" -eq 1 || "$linux_gui" -eq 1) ]]; then + echo "script/check: --e2e-only is step 5 alone, without --fast, --linux or --linux-gui" >&2 + exit 2 +fi root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" cd "$root" @@ -71,50 +80,52 @@ step() { # The crates that must never depend on gpui, even transitively (PLAN §4). headless_crates=(dv_core dv_backend dv_cli dv_lsp mock_gh mock_lsp dv_test_support dv_package dv_e2e) -step 1 "cargo fmt --all --check" -cargo fmt --all --check +if [[ "$e2e_only" -eq 0 ]]; then + step 1 "cargo fmt --all --check" + cargo fmt --all --check -# dv's three shapes (PLAN §13.1): each drifts silently unless it is linted on its own. -step 2 "cargo clippy --workspace --all-targets -- -D warnings (dv: gui + automation)" -cargo clippy --workspace --all-targets -- -D warnings -step 2 "cargo clippy -p dv --no-default-features --features gui --all-targets -- -D warnings (the shipped app)" -cargo clippy -p dv --no-default-features --features gui --all-targets -- -D warnings -step 2 "cargo clippy -p dv --no-default-features --all-targets -- -D warnings (headless: the WSL build)" -cargo clippy -p dv --no-default-features --all-targets -- -D warnings + # dv's three shapes (PLAN §13.1): each drifts silently unless it is linted on its own. + step 2 "cargo clippy --workspace --all-targets -- -D warnings (dv: gui + automation)" + cargo clippy --workspace --all-targets -- -D warnings + step 2 "cargo clippy -p dv --no-default-features --features gui --all-targets -- -D warnings (the shipped app)" + cargo clippy -p dv --no-default-features --features gui --all-targets -- -D warnings + step 2 "cargo clippy -p dv --no-default-features --all-targets -- -D warnings (headless: the WSL build)" + cargo clippy -p dv --no-default-features --all-targets -- -D warnings -step 3 "gpui boundary: ${headless_crates[*]} and the headless dv" -boundary_ok=1 -# Normal dependencies only (dev-dependencies may use gpui's test support), every target -# platform, one crate per line without tree drawing. `$1` names the check, the rest are -# `cargo tree`'s package and feature arguments. -check_boundary() { - local name="$1" - shift - local tree offenders - tree="$(cargo tree "$@" -e normal --target all --prefix none)" - # gpui's own crates (gpui-pre*, gpui-component, gpui-base, gpui-kit-assets) are hyphenated; - # toolbox-rs's gpui-free automation crates (gpui_automation_runner, …_protocol) are not. - offenders="$(printf '%s\n' "$tree" | grep -E '^gpui-' | sed 's/ (\*)$//' | sort -u || true)" - if [[ -n "$offenders" ]]; then - boundary_ok=0 - echo "error: $name depends on gpui:" >&2 - printf '%s\n' "$offenders" | sed 's/^/ /' >&2 - echo " (cargo tree $* -e normal --target all -i shows the path to one)" >&2 - else - echo "ok: $name" + step 3 "gpui boundary: ${headless_crates[*]} and the headless dv" + boundary_ok=1 + # Normal dependencies only (dev-dependencies may use gpui's test support), every target + # platform, one crate per line without tree drawing. `$1` names the check, the rest are + # `cargo tree`'s package and feature arguments. + check_boundary() { + local name="$1" + shift + local tree offenders + tree="$(cargo tree "$@" -e normal --target all --prefix none)" + # gpui's own crates (gpui-pre*, gpui-component, gpui-base, gpui-kit-assets) are hyphenated; + # toolbox-rs's gpui-free automation crates (gpui_automation_runner, …_protocol) are not. + offenders="$(printf '%s\n' "$tree" | grep -E '^gpui-' | sed 's/ (\*)$//' | sort -u || true)" + if [[ -n "$offenders" ]]; then + boundary_ok=0 + echo "error: $name depends on gpui:" >&2 + printf '%s\n' "$offenders" | sed 's/^/ /' >&2 + echo " (cargo tree $* -e normal --target all -i shows the path to one)" >&2 + else + echo "ok: $name" + fi + } + for crate in "${headless_crates[@]}"; do + check_boundary "$crate" -p "$crate" --all-features + done + # The static musl build installed into WSL distros: the CLI and `dv backend --stdio`. + check_boundary "dv --no-default-features" -p dv --no-default-features + if [[ "$boundary_ok" -ne 1 ]]; then + exit 1 fi -} -for crate in "${headless_crates[@]}"; do - check_boundary "$crate" -p "$crate" --all-features -done -# The static musl build installed into WSL distros: the CLI and `dv backend --stdio`. -check_boundary "dv --no-default-features" -p dv --no-default-features -if [[ "$boundary_ok" -ne 1 ]]; then - exit 1 -fi -step 4 "cargo test --workspace" -cargo test --workspace + step 4 "cargo test --workspace" + cargo test --workspace +fi if [[ "$fast" -eq 1 ]]; then step 5 "e2e scenarios: skipped (--fast)" From e1df56b79a8776a590037a4112b0287d69212a61 Mon Sep 17 00:00:00 2001 From: kylekz Date: Tue, 10 Nov 2026 01:09:15 +1300 Subject: [PATCH 2/2] release.yml: say why main-ci reads actions (zizmor) Co-Authored-By: Claude Opus 5.5 --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 622fab2..c8f9c60 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -77,7 +77,7 @@ jobs: runs-on: ubuntu-24.04 timeout-minutes: 120 permissions: - actions: read + actions: read # lists and watches main's CI runs outputs: passed: ${{ steps.main.outputs.passed }} steps: