From 3a3202f437ff9db22eafb3a9fd5343cae59380d5 Mon Sep 17 00:00:00 2001 From: piquel Date: Sat, 21 Nov 2026 18:14:44 +0100 Subject: [PATCH 1/4] ci: pushes to main only build what the caches keep Main receives the very commit the merge queue tested, so its run now skips every test and the jobs that save no cache, and only builds what the Rust caches and the images' layers keep. --- .github/workflows/ci.yml | 63 ++++++++++++++++++++++++++-------------- docs/dev/testing.md | 15 ++++++++-- 2 files changed, 54 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef7185b88..a07d28230 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,17 +27,21 @@ # # Pull requests run only the jobs their changes can affect (see `changes`), # except `docs`: a change anywhere can break a link to it. -# The merge queue, pushes to main and manual runs run everything: the queue -# tests each pull request on top of the latest main before it merges, so two -# pull requests that pass alone cannot break main together. `ci` is the single -# status to require, and the queue waits for it: it fails if any job failed -# and passes when the rest succeeded or were skipped. audit.yml audits new -# advisories weekly. +# The merge queue and manual runs run everything: the queue tests each pull +# request on top of the latest main before it merges, so two pull requests that +# pass alone cannot break main together. `ci` is the single status to require, +# and the queue waits for it: it fails if any job failed and passes when the +# rest succeeded or were skipped. audit.yml audits new advisories weekly. # -# Rust caches, and the Rust images' layers, are saved from main only. Pull -# requests restore main's caches, so a branch never evicts them with copies no -# other branch can read. pnpm's small store cache is saved whenever its lockfile -# hash is new. +# Rust caches, and the Rust images' layers, are saved from main only: GitHub +# scopes a cache to the branch that saved it, and every other branch, the +# queue's included, can read main's. A branch so never evicts main's caches +# with copies no other branch can read. pnpm's small store cache is saved +# whenever its lockfile hash is new. +# +# Main receives the very commit the queue tested, so pushes to main test +# nothing again: they only build what the caches keep, skipping every step +# marked `if: *tested` and the jobs that compile nothing. name: CI @@ -113,7 +117,7 @@ jobs: checks: name: checks needs: changes - if: needs.changes.outputs.rust == 'true' || needs.changes.outputs.deps == 'true' + if: github.event_name != 'push' && (needs.changes.outputs.rust == 'true' || needs.changes.outputs.deps == 'true') runs-on: ubuntu-latest timeout-minutes: 10 steps: @@ -126,10 +130,11 @@ jobs: - if: needs.changes.outputs.deps == 'true' run: just rust audit + # Skipped on main, whose pnpm store cache `package` and `e2e` save. web: name: web needs: changes - if: needs.changes.outputs.web == 'true' || needs.changes.outputs.deps == 'true' + if: github.event_name != 'push' && (needs.changes.outputs.web == 'true' || needs.changes.outputs.deps == 'true') runs-on: ubuntu-latest timeout-minutes: 15 steps: @@ -162,7 +167,9 @@ jobs: # Clippy, rustdoc and the doc tests, beside `rust`: its coverage builds an # instrumented copy of everything, in target/llvm-cov-target, which they cannot # reuse. The doc tests reuse the dependencies Clippy compiled for build scripts - # and proc macros. + # and proc macros. Main still runs Clippy and the doc tests, which compile what + # the cache keeps: the doc tests are merged into one binary, which runs in + # about a second. rust-lint: name: rust-lint needs: changes @@ -181,7 +188,9 @@ jobs: prefix-key: v1-rust save-if: ${{ github.ref == 'refs/heads/main' }} - run: just rust lint - - run: just doc + # Steps main skips: they only test what the queue already tested. + - if: &tested github.event_name != 'push' + run: just doc - run: just doc-test # Everything `just publish` does except uploading: packages each crate and @@ -255,8 +264,13 @@ jobs: # Every unit and database test, instrumented. Coverage is reported, not # enforced: per crate in the log, per line in the rust-coverage artifact. # cargo-llvm-cov adds the llvm-tools-preview component it needs. - - run: just coverage - - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + - if: *tested + run: just coverage + # Main builds the same instrumented tests, and runs none of them. + - if: github.event_name == 'push' + run: cargo llvm-cov nextest --locked --workspace --no-report -E 'none()' --no-tests=pass + - if: *tested + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: rust-coverage path: target/lcov.info @@ -264,7 +278,8 @@ jobs: # The database tests migrated TEST_DATABASE_URL, so a migration that # breaks a cached query fails here even if no test runs that query, as # does a cached query the code no longer uses. - - run: just db prepare-check + - if: *tested + run: just db prepare-check e2e: name: e2e @@ -331,6 +346,7 @@ jobs: # `user recover`, which derives its link with the token digest key, share # them with the service. - name: Generate the keys + if: *tested run: | just auth generate-secret "$RUNNER_TEMP/key-encryption-key" just auth generate-secret "$RUNNER_TEMP/token-digest-key" @@ -345,6 +361,7 @@ jobs: # The suite signs in through the public OIDC client from # tests/browser/README.md, whose origin has no server. - name: Start the auth service and sourceorigin.dev + if: *tested run: | cat > "$RUNNER_TEMP/Caddyfile" <<'EOF' { @@ -370,8 +387,10 @@ jobs: curl -kfsS --retry 30 --retry-delay 1 --retry-all-errors "$E2E_WEB_URL/health" # The headless build matching the pinned Playwright, so runner image # updates cannot change the browser under test. - - run: pnpm exec playwright install --only-shell chromium - - run: just web test-browser + - if: *tested + run: pnpm exec playwright install --only-shell chromium + - if: *tested + run: just web test-browser - if: failure() run: | cat "$RUNNER_TEMP"/*.log || true @@ -419,11 +438,13 @@ jobs: - *install-just - *rust-cache - run: cargo install --locked piquelctl - - run: just infra check + - if: *tested + run: just infra check # mdBook and lychee at the versions `just install-tools` installs. docs: name: docs + if: github.event_name != 'push' runs-on: ubuntu-latest timeout-minutes: 10 steps: @@ -453,5 +474,5 @@ jobs: steps: - uses: re-actors/alls-green@b5b5b37504aa4183270bd3d855c52a67f212be35 # v1.3.0 with: - allowed-skips: checks, web, rust, rust-lint, package, msrv, e2e, docker, infra + allowed-skips: checks, web, rust, rust-lint, package, msrv, e2e, docker, infra, docs jobs: ${{ toJSON(needs) }} diff --git a/docs/dev/testing.md b/docs/dev/testing.md index 0622a1dc4..49510e374 100644 --- a/docs/dev/testing.md +++ b/docs/dev/testing.md @@ -219,9 +219,18 @@ pull request, since a change anywhere can break a link to it. The `changes` job in [ci.yml](https://github.com/sourceorigin-dev/sourceorigin/blob/main/.github/workflows/ci.yml) has the exact filters. -The merge queue, pushes to `main` and manual runs run every job. The `ci` check -sums the others up: it fails if any job failed, and passes when the rest -succeeded or were skipped. It is the one check the merge queue waits for. +The merge queue and manual runs run every job. The `ci` check sums the others +up: it fails if any job failed, and passes when the rest succeeded or were +skipped. It is the one check the merge queue waits for. + +`main` receives the exact commit the merge queue tested, so a push to `main` +doesn't test it again. It only builds, to save the Rust caches and the images' +layers. GitHub lets every branch read `main`'s caches, so pull requests and the +merge queue start from them. `checks`, `web` and `docs` save no cache of their +own, so `main` skips them. `rust` builds its instrumented tests without running +them, `e2e` builds the binaries without starting the browser suite, and `infra` +installs piquelctl without checking the manifests. `rust-lint` still runs +Clippy and the doc tests, since they are the compile it caches. Coverage is reported, never enforced. `rust` prints it per crate and uploads `target/lcov.info` as the `rust-coverage` artifact, and `just web test` prints From 7a23cd28b952cbc121b6c27a677708b2e5e30afc Mon Sep 17 00:00:00 2001 From: piquel Date: Sat, 21 Nov 2026 18:39:26 +0100 Subject: [PATCH 2/4] ci: main builds only when a cache key changed, through shared recipes --- .github/workflows/ci.yml | 68 +++++++++++++++++++++++++--------------- docs/dev/releasing.md | 2 +- docs/dev/testing.md | 19 ++++++----- just/db.just | 9 +++++- justfile | 10 +++++- 5 files changed, 72 insertions(+), 36 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a07d28230..f33bd5e04 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,8 +40,11 @@ # whenever its lockfile hash is new. # # Main receives the very commit the queue tested, so pushes to main test -# nothing again: they only build what the caches keep, skipping every step -# marked `if: *tested` and the jobs that compile nothing. +# nothing again: they only refresh the caches. They skip the jobs that save no +# cache and every step marked `if: *tests`. rust-cache saves only when the key +# it restored differs, as after a dependency or toolchain change, so a Rust +# step marked `if: *builds` runs on main only then. The images' layers are +# saved on every push. name: CI @@ -167,9 +170,8 @@ jobs: # Clippy, rustdoc and the doc tests, beside `rust`: its coverage builds an # instrumented copy of everything, in target/llvm-cov-target, which they cannot # reuse. The doc tests reuse the dependencies Clippy compiled for build scripts - # and proc macros. Main still runs Clippy and the doc tests, which compile what - # the cache keeps: the doc tests are merged into one binary, which runs in - # about a second. + # and proc macros. Each of the three compiles dependencies the others don't, + # so main runs all three when it saves a new cache. rust-lint: name: rust-lint needs: changes @@ -180,6 +182,7 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - *install-just - &rust-cache + id: rust-cache uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2 with: # rust-cache's key ignores this workflow, but includes the job's ID. @@ -187,11 +190,14 @@ jobs: # installing sqlx-cli. prefix-key: v1-rust save-if: ${{ github.ref == 'refs/heads/main' }} - - run: just rust lint - # Steps main skips: they only test what the queue already tested. - - if: &tested github.event_name != 'push' + # Builds that main runs only when rust-cache restored no exact match, so + # that it saves a new cache. Every other run runs them. + - if: &builds github.event_name != 'push' || steps.rust-cache.outputs.cache-hit != 'true' + run: just rust lint + - if: *builds run: just doc - - run: just doc-test + - if: *builds + run: just doc-test # Everything `just publish` does except uploading: packages each crate and # builds it from its package, as `cargo install` and crates.io would, then @@ -209,7 +215,8 @@ jobs: - *setup-node - *rust-cache - run: just install - - run: just publish --dry-run + - if: *builds + run: just publish --dry-run # Builds the published crates with the oldest Rust their `rust-version` # promises. Warnings aren't errors here: lints differ between Rust versions, @@ -231,8 +238,10 @@ jobs: echo "RUSTUP_TOOLCHAIN=$msrv" >> "$GITHUB_ENV" - *install-just - *rust-cache - - run: cargo check --locked --all-features --package sourceorigin-common --package sourceorigin-crypto --package sourceorigin-auth - - run: just rust features + - if: *builds + run: cargo check --locked --all-features --package sourceorigin-common --package sourceorigin-crypto --package sourceorigin-auth + - if: *builds + run: just rust features rust: name: rust @@ -260,16 +269,15 @@ jobs: # sqlx-cli publishes no prebuilt binaries. rust-cache keeps binaries # installed after it restores, so this compiles when main's cache lacks # the latest release, until main next saves a cache. - - run: just db install-sqlx + - if: *builds + run: just db install-sqlx # Every unit and database test, instrumented. Coverage is reported, not # enforced: per crate in the log, per line in the rust-coverage artifact. # cargo-llvm-cov adds the llvm-tools-preview component it needs. - - if: *tested + # Steps main skips: they test what the queue already tested. + - if: &tests github.event_name != 'push' run: just coverage - # Main builds the same instrumented tests, and runs none of them. - - if: github.event_name == 'push' - run: cargo llvm-cov nextest --locked --workspace --no-report -E 'none()' --no-tests=pass - - if: *tested + - if: *tests uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: rust-coverage @@ -278,8 +286,14 @@ jobs: # The database tests migrated TEST_DATABASE_URL, so a migration that # breaks a cached query fails here even if no test runs that query, as # does a cached query the code no longer uses. - - if: *tested + - if: *tests run: just db prepare-check + # When main saves a new cache, it compiles what the two steps above do, + # without running a test or needing a database. + - if: github.event_name == 'push' && steps.rust-cache.outputs.cache-hit != 'true' + run: | + just coverage-build + just db check e2e: name: e2e @@ -341,12 +355,13 @@ jobs: - run: just install # The binary embeds the passkey script and the stylesheet, as in the # deployed image. - - run: just rust build + - if: *builds + run: just rust build # The keys reach every later step, so the commands the suite runs, such as # `user recover`, which derives its link with the token digest key, share # them with the service. - name: Generate the keys - if: *tested + if: *tests run: | just auth generate-secret "$RUNNER_TEMP/key-encryption-key" just auth generate-secret "$RUNNER_TEMP/token-digest-key" @@ -361,7 +376,7 @@ jobs: # The suite signs in through the public OIDC client from # tests/browser/README.md, whose origin has no server. - name: Start the auth service and sourceorigin.dev - if: *tested + if: *tests run: | cat > "$RUNNER_TEMP/Caddyfile" <<'EOF' { @@ -387,9 +402,9 @@ jobs: curl -kfsS --retry 30 --retry-delay 1 --retry-all-errors "$E2E_WEB_URL/health" # The headless build matching the pinned Playwright, so runner image # updates cannot change the browser under test. - - if: *tested + - if: *tests run: pnpm exec playwright install --only-shell chromium - - if: *tested + - if: *tests run: just web test-browser - if: failure() run: | @@ -437,8 +452,9 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - *install-just - *rust-cache - - run: cargo install --locked piquelctl - - if: *tested + - if: *builds + run: cargo install --locked piquelctl + - if: *tests run: just infra check # mdBook and lychee at the versions `just install-tools` installs. diff --git a/docs/dev/releasing.md b/docs/dev/releasing.md index 6526df94c..0b2b47f45 100644 --- a/docs/dev/releasing.md +++ b/docs/dev/releasing.md @@ -113,7 +113,7 @@ toolchain of `rust-toolchain.toml`, Node and pnpm. git switch main && git pull ``` - Wait for its CI run to pass. + The merge queue tested this exact commit before merging it. 3. Check the release without changing anything: ```console diff --git a/docs/dev/testing.md b/docs/dev/testing.md index 49510e374..84d9543bd 100644 --- a/docs/dev/testing.md +++ b/docs/dev/testing.md @@ -224,13 +224,18 @@ up: it fails if any job failed, and passes when the rest succeeded or were skipped. It is the one check the merge queue waits for. `main` receives the exact commit the merge queue tested, so a push to `main` -doesn't test it again. It only builds, to save the Rust caches and the images' -layers. GitHub lets every branch read `main`'s caches, so pull requests and the -merge queue start from them. `checks`, `web` and `docs` save no cache of their -own, so `main` skips them. `rust` builds its instrumented tests without running -them, `e2e` builds the binaries without starting the browser suite, and `infra` -installs piquelctl without checking the manifests. `rust-lint` still runs -Clippy and the doc tests, since they are the compile it caches. +doesn't test it again. It only refreshes the caches that pull requests and the +merge queue start from, since GitHub lets every branch read `main`'s caches: + +- `checks`, `web` and `docs` save no cache of their own, so `main` skips them. +- `docker` builds the images, saving their layers. +- The Rust jobs build only when their cache's key changed, as after a + dependency or toolchain change: an unchanged key keeps the cache it has. Then + `rust` runs `just coverage-build` and `just db check`, which compile what its + tests do without running them, and `e2e` builds the binaries without starting + the browser suite. + +A commit's coverage report is in its merge queue run. Coverage is reported, never enforced. `rust` prints it per crate and uploads `target/lcov.info` as the `rust-coverage` artifact, and `just web test` prints diff --git a/just/db.just b/just/db.just index 5403963ab..6e1f20c2d 100644 --- a/just/db.just +++ b/just/db.just @@ -35,9 +35,16 @@ prepare: # Test targets and the `test-util` feature are included so checked queries # compiled only for tests are cached too. +prepare_targets := '--all-targets --all-features' + [positional-arguments] _prepare *ARGS: - @cd crates/database && cargo sqlx prepare "$@" -- --all-targets --all-features + @cd crates/database && cargo sqlx prepare "$@" -- {{ prepare_targets }} + +# CI's pushes to main run it to cache the build `prepare-check` compiles. +# Compile what `prepare` checks, from the committed query cache, with no database. +check: + @cd crates/database && cargo check --locked {{ prepare_targets }} # DATABASE_URL, TEST_DATABASE_URL and libpq's PG* variables point at the cluster, # which listens only on a socket under /tmp (socket paths are limited to about 100 diff --git a/justfile b/justfile index 50fb28a2d..fd0adf0f2 100644 --- a/justfile +++ b/justfile @@ -80,6 +80,9 @@ doc: doc-test: @cargo test --locked --doc --workspace +# The instrumented test build `coverage` runs and `coverage-build` compiles. +llvm_cov := 'cargo llvm-cov nextest --locked --workspace' + # Uses a scratch cluster unless TEST_DATABASE_URL names a disposable database, # which the database tests leave migrated. Instrumented builds live in # target/llvm-cov-target; `cargo llvm-cov report --html` renders the last run. @@ -91,7 +94,7 @@ coverage *ARGS: #!/usr/bin/env bash set -euo pipefail if [[ -z "${TEST_DATABASE_URL:-}" ]]; then exec just db scratch just coverage "$@"; fi - cargo llvm-cov nextest --locked --workspace --run-ignored all --lcov --output-path target/lcov.info "$@" + {{ llvm_cov }} --run-ignored all --lcov --output-path target/lcov.info "$@" # lcov names each source file by absolute path; its crate is the # apps/ or crates/ directory holding it. awk -v root="$PWD/" ' @@ -106,6 +109,11 @@ coverage *ARGS: close("sort"); print row("workspace", LH, LF, FH, FF) }' target/lcov.info +# CI's pushes to main run it to cache the build without running a test. +# Compile every test `coverage` runs, instrumented, and run none of them. +coverage-build: + @{{ llvm_cov }} --no-report -E 'none()' --no-tests=pass + # Regenerate tests/sdk-vectors; `just test` fails while the committed files are stale. sdk-vectors: @UPDATE_SDK_VECTORS=1 cargo nextest run --locked -p sourceorigin-crypto --test sdk_vectors From b32992ceac4c3b5729b8922193c4d408b0d80407 Mon Sep 17 00:00:00 2001 From: piquel Date: Sat, 21 Nov 2026 19:02:47 +0100 Subject: [PATCH 3/4] ci: main compiles the doc tests without running them, and the cleanup skill reads coverage from the queue --- .agents/skills/sourceorigin-cleanup/SKILL.md | 6 ++++-- .github/workflows/ci.yml | 14 ++++++++------ docs/dev/testing.md | 14 ++++++++------ justfile | 7 +++++-- 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/.agents/skills/sourceorigin-cleanup/SKILL.md b/.agents/skills/sourceorigin-cleanup/SKILL.md index 231a3cd72..f8ee01db5 100644 --- a/.agents/skills/sourceorigin-cleanup/SKILL.md +++ b/.agents/skills/sourceorigin-cleanup/SKILL.md @@ -36,8 +36,10 @@ other labels that fit (`gh label list`). `html_preview` and `html_render`, including growth over time from the JSON. 2. Read the output, then check what the script can't count: - - coverage, from the `rust-coverage` artifact of `main`'s latest CI run (or - `just coverage`) and `just web test` + - coverage, from the `rust-coverage` artifact of the latest merge queue run + (`gh run list -w ci.yml -e merge_group -s success -L 1`, then + `gh run download -n rust-coverage`), or `just coverage`, and + `just web test` - unused code and dependencies, with `just unused` - generated files missing from `.gitattributes` - which `expect` calls can really panic diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f33bd5e04..56494e12c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,11 +40,12 @@ # whenever its lockfile hash is new. # # Main receives the very commit the queue tested, so pushes to main test -# nothing again: they only refresh the caches. They skip the jobs that save no -# cache and every step marked `if: *tests`. rust-cache saves only when the key -# it restored differs, as after a dependency or toolchain change, so a Rust -# step marked `if: *builds` runs on main only then. The images' layers are -# saved on every push. +# nothing again: they only refresh the caches. They skip the jobs whose cache +# another job saves too, or that save none, and every step marked +# `if: *tests`. rust-cache saves only when no cache is saved under its current +# key, as after a dependency or toolchain change or an eviction, so a step +# marked `if: *builds` runs on main only then. The images' layers are saved on +# every push. name: CI @@ -197,7 +198,7 @@ jobs: - if: *builds run: just doc - if: *builds - run: just doc-test + run: just doc-test ${{ github.event_name == 'push' && '--list' || '' }} # Everything `just publish` does except uploading: packages each crate and # builds it from its package, as `cargo install` and crates.io would, then @@ -274,6 +275,7 @@ jobs: # Every unit and database test, instrumented. Coverage is reported, not # enforced: per crate in the log, per line in the rust-coverage artifact. # cargo-llvm-cov adds the llvm-tools-preview component it needs. + # # Steps main skips: they test what the queue already tested. - if: &tests github.event_name != 'push' run: just coverage diff --git a/docs/dev/testing.md b/docs/dev/testing.md index 84d9543bd..9fdc68128 100644 --- a/docs/dev/testing.md +++ b/docs/dev/testing.md @@ -227,13 +227,15 @@ skipped. It is the one check the merge queue waits for. doesn't test it again. It only refreshes the caches that pull requests and the merge queue start from, since GitHub lets every branch read `main`'s caches: -- `checks`, `web` and `docs` save no cache of their own, so `main` skips them. +- `checks` and `docs` save no cache, and `web` saves only the pnpm store, + which `package` and `e2e` save too, so `main` skips them. - `docker` builds the images, saving their layers. -- The Rust jobs build only when their cache's key changed, as after a - dependency or toolchain change: an unchanged key keeps the cache it has. Then - `rust` runs `just coverage-build` and `just db check`, which compile what its - tests do without running them, and `e2e` builds the binaries without starting - the browser suite. +- The jobs that restore a Rust cache build only when no cache is saved under + their current key, as after a dependency or toolchain change, or after GitHub + evicts an unused cache. Then they build without testing: `rust` runs + `just coverage-build` and `just db check`, `rust-lint` compiles the doc tests + without running them, `e2e` builds the binaries without starting the browser + suite, and `infra` installs piquelctl without checking the manifests. A commit's coverage report is in its merge queue run. diff --git a/justfile b/justfile index fd0adf0f2..15fe59fa9 100644 --- a/justfile +++ b/justfile @@ -77,8 +77,11 @@ test *ARGS='--workspace': doc: @RUSTDOCFLAGS='-D warnings' cargo doc --locked --workspace --no-deps -doc-test: - @cargo test --locked --doc --workspace +# Extra arguments go to the doc tests; CI's pushes to main pass `--list` to +# compile them without running them. +[positional-arguments] +doc-test *ARGS: + @cargo test --locked --doc --workspace -- "$@" # The instrumented test build `coverage` runs and `coverage-build` compiles. llvm_cov := 'cargo llvm-cov nextest --locked --workspace' From 66317d4cdbf2107c042e74418922c9b441e14879 Mon Sep 17 00:00:00 2001 From: piquel Date: Sat, 21 Nov 2026 19:08:49 +0100 Subject: [PATCH 4/4] docs: name every job main builds on a cache miss --- .github/workflows/ci.yml | 2 +- docs/dev/testing.md | 10 ++++++---- justfile | 5 +++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 56494e12c..f89ae1788 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ # # Rust caches, and the Rust images' layers, are saved from main only: GitHub # scopes a cache to the branch that saved it, and every other branch, the -# queue's included, can read main's. A branch so never evicts main's caches +# queue's included, can read main's. So a branch never evicts main's caches # with copies no other branch can read. pnpm's small store cache is saved # whenever its lockfile hash is new. # diff --git a/docs/dev/testing.md b/docs/dev/testing.md index 9fdc68128..796851f56 100644 --- a/docs/dev/testing.md +++ b/docs/dev/testing.md @@ -232,10 +232,12 @@ merge queue start from, since GitHub lets every branch read `main`'s caches: - `docker` builds the images, saving their layers. - The jobs that restore a Rust cache build only when no cache is saved under their current key, as after a dependency or toolchain change, or after GitHub - evicts an unused cache. Then they build without testing: `rust` runs - `just coverage-build` and `just db check`, `rust-lint` compiles the doc tests - without running them, `e2e` builds the binaries without starting the browser - suite, and `infra` installs piquelctl without checking the manifests. + evicts an unused cache. Then they build without testing. `package` and + `msrv` run as usual, since they only build. `rust-lint` runs Clippy and + rustdoc, and compiles the doc tests without running them. `rust` runs + `just coverage-build` and `just db check`, `e2e` builds the binaries without + starting the browser suite, and `infra` installs piquelctl without checking + the manifests. A commit's coverage report is in its merge queue run. diff --git a/justfile b/justfile index 15fe59fa9..264d95714 100644 --- a/justfile +++ b/justfile @@ -77,8 +77,9 @@ test *ARGS='--workspace': doc: @RUSTDOCFLAGS='-D warnings' cargo doc --locked --workspace --no-deps -# Extra arguments go to the doc tests; CI's pushes to main pass `--list` to -# compile them without running them. +# CI's pushes to main pass `--list`, which compiles the merged doc tests +# without running them; one that can't be merged compiles only when it runs. +# Run the doc tests; extra arguments go to them. [positional-arguments] doc-test *ARGS: @cargo test --locked --doc --workspace -- "$@"