diff --git a/.github/workflows/ai-core.yml b/.github/workflows/ai-core.yml index 6f5b34e892..2be123b233 100644 --- a/.github/workflows/ai-core.yml +++ b/.github/workflows/ai-core.yml @@ -3,7 +3,7 @@ name: AI model on: workflow_dispatch: push: - branches: [main, next] + branches: [main] paths: ['crates/ai-core/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/ai-core.yml'] pull_request: paths: ['crates/ai-core/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/ai-core.yml'] diff --git a/.github/workflows/atomic.yml b/.github/workflows/atomic.yml index b8bcc8b8ea..6afdafc290 100644 --- a/.github/workflows/atomic.yml +++ b/.github/workflows/atomic.yml @@ -3,7 +3,7 @@ name: Atomic file writes on: workflow_dispatch: push: - branches: [main, next] + branches: [main] paths: ['crates/atomic/**', 'crates/settings/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/atomic.yml'] pull_request: paths: ['crates/atomic/**', 'crates/settings/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/atomic.yml'] diff --git a/.github/workflows/audio.yml b/.github/workflows/audio.yml index 6063c4e4dc..5fd971c629 100644 --- a/.github/workflows/audio.yml +++ b/.github/workflows/audio.yml @@ -2,7 +2,7 @@ name: Shared audio on: push: - branches: [main, next] + branches: [main] paths: ["crates/audio/**", "crates/media/**", "crates/media-testkit/**", "scripts/fetch-opus-vectors.sh", "Cargo.toml", "Cargo.lock", ".github/workflows/audio.yml"] pull_request: paths: ["crates/audio/**", "crates/media/**", "crates/media-testkit/**", "scripts/fetch-opus-vectors.sh", "Cargo.toml", "Cargo.lock", ".github/workflows/audio.yml"] diff --git a/.github/workflows/cms.yml b/.github/workflows/cms.yml index b13dd82d14..c1737392da 100644 --- a/.github/workflows/cms.yml +++ b/.github/workflows/cms.yml @@ -3,7 +3,7 @@ name: Colour management on: workflow_dispatch: push: - branches: [main, next] + branches: [main] paths: ['crates/cms/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/cms.yml'] pull_request: paths: ['crates/cms/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/cms.yml'] diff --git a/.github/workflows/crw.yml b/.github/workflows/crw.yml index 3e9b430d67..10e5b7ccf7 100644 --- a/.github/workflows/crw.yml +++ b/.github/workflows/crw.yml @@ -2,7 +2,7 @@ name: Shared CRW on: push: - branches: [main, next] + branches: [main] paths: ["crates/crw/**", "scripts/fetch-crw-samples.py", "Cargo.toml", "Cargo.lock", ".github/workflows/crw.yml"] pull_request: paths: ["crates/crw/**", "scripts/fetch-crw-samples.py", "Cargo.toml", "Cargo.lock", ".github/workflows/crw.yml"] @@ -52,7 +52,7 @@ jobs: - uses: step-security/dtolnay-rust-toolchain@v1.0.0 with: toolchain: stable - # Pull requests restore the entry main or next saved and never write their own: the same + # Pull requests restore the entry main saved and never write their own: the same # files saved once per pull request took a share of the 10 GB cache budget. - name: Restore the CC0 sample files id: samples diff --git a/.github/workflows/dialogs.yml b/.github/workflows/dialogs.yml index f9ab8fe56e..23def9feb0 100644 --- a/.github/workflows/dialogs.yml +++ b/.github/workflows/dialogs.yml @@ -3,7 +3,7 @@ name: Dialogs on: workflow_dispatch: push: - branches: [main, next] + branches: [main] paths: ['crates/dialogs/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/dialogs.yml'] pull_request: paths: ['crates/dialogs/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/dialogs.yml'] diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 00b8336db1..6275433817 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -3,7 +3,7 @@ name: Craft documents on: workflow_dispatch: push: - branches: [main, next] + branches: [main] paths: ['crates/doc/**', 'crates/pcraft-format/**', 'crates/vectorcraft-format/**', 'crates/ecproj-format/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/doc.yml'] pull_request: paths: ['crates/doc/**', 'crates/pcraft-format/**', 'crates/vectorcraft-format/**', 'crates/ecproj-format/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/doc.yml'] diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index fc51a0da51..cb54dbf119 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -6,7 +6,7 @@ name: Docs on: workflow_dispatch: push: - branches: [main, next] + branches: [main] paths: ['crates/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/docs.yml'] pull_request: paths: ['crates/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/docs.yml'] diff --git a/.github/workflows/ecproj-format.yml b/.github/workflows/ecproj-format.yml index bec96fed5c..048c897b3c 100644 --- a/.github/workflows/ecproj-format.yml +++ b/.github/workflows/ecproj-format.yml @@ -3,7 +3,7 @@ name: EffectCraft project format on: workflow_dispatch: push: - branches: [main, next] + branches: [main] paths: ['crates/ecproj-format/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/ecproj-format.yml'] pull_request: paths: ['crates/ecproj-format/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/ecproj-format.yml'] diff --git a/.github/workflows/font-store.yml b/.github/workflows/font-store.yml index fd599d207c..e655697b3d 100644 --- a/.github/workflows/font-store.yml +++ b/.github/workflows/font-store.yml @@ -3,7 +3,7 @@ name: Font store on: workflow_dispatch: push: - branches: [main, next] + branches: [main] paths: ['crates/font-store/**', 'crates/font-catalog/**', 'crates/atomic/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/font-store.yml'] pull_request: paths: ['crates/font-store/**', 'crates/font-catalog/**', 'crates/atomic/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/font-store.yml'] diff --git a/.github/workflows/formats.yml b/.github/workflows/formats.yml index 22d90712e8..2ee6fc6281 100644 --- a/.github/workflows/formats.yml +++ b/.github/workflows/formats.yml @@ -2,7 +2,7 @@ name: Shared format crates on: push: - branches: [main, next] + branches: [main] paths: - "crates/xml/**" - "crates/mime/**" diff --git a/.github/workflows/house-rules.yml b/.github/workflows/house-rules.yml index 7ee967c65b..de64ad3ee4 100644 --- a/.github/workflows/house-rules.yml +++ b/.github/workflows/house-rules.yml @@ -2,7 +2,7 @@ name: House rules on: push: - branches: [main, next] + branches: [main] paths: - AGENTS.md - CLAUDE.md diff --git a/.github/workflows/jpeg.yml b/.github/workflows/jpeg.yml index ebb27bafde..495af8b232 100644 --- a/.github/workflows/jpeg.yml +++ b/.github/workflows/jpeg.yml @@ -2,7 +2,7 @@ name: Shared JPEG on: push: - branches: [main, next] + branches: [main] paths: ["crates/jpeg/**", "Cargo.toml", "Cargo.lock", ".github/workflows/jpeg.yml"] pull_request: paths: ["crates/jpeg/**", "Cargo.toml", "Cargo.lock", ".github/workflows/jpeg.yml"] diff --git a/.github/workflows/keymap.yml b/.github/workflows/keymap.yml index bfce473788..47a5576499 100644 --- a/.github/workflows/keymap.yml +++ b/.github/workflows/keymap.yml @@ -2,7 +2,7 @@ name: Keymap on: push: - branches: [main, next] + branches: [main] paths: ["crates/keymap/**", "crates/settings/**", "crates/ui/**", "crates/ui-contract/**", "crates/ui-widgets/**", "crates/ui-panels/**", "crates/ui-canvas/**", "crates/ui-patterns/**", "crates/ui-shell/**", "crates/i18n/**", "Cargo.toml", "Cargo.lock", ".github/workflows/keymap.yml"] pull_request: paths: ["crates/keymap/**", "crates/settings/**", "crates/ui/**", "crates/ui-contract/**", "crates/ui-widgets/**", "crates/ui-panels/**", "crates/ui-canvas/**", "crates/ui-patterns/**", "crates/ui-shell/**", "crates/i18n/**", "Cargo.toml", "Cargo.lock", ".github/workflows/keymap.yml"] diff --git a/.github/workflows/media.yml b/.github/workflows/media.yml index 090ad84da9..f4c4e6689b 100644 --- a/.github/workflows/media.yml +++ b/.github/workflows/media.yml @@ -2,7 +2,7 @@ name: Shared media on: push: - branches: [main, next] + branches: [main] paths: ["crates/media/**", "crates/media-testkit/**", "Cargo.toml", "Cargo.lock", ".github/workflows/media.yml"] pull_request: paths: ["crates/media/**", "crates/media-testkit/**", "Cargo.toml", "Cargo.lock", ".github/workflows/media.yml"] diff --git a/.github/workflows/menu.yml b/.github/workflows/menu.yml index 80b6678cd3..b12c8bcc6a 100644 --- a/.github/workflows/menu.yml +++ b/.github/workflows/menu.yml @@ -2,7 +2,7 @@ name: Menu on: push: - branches: [main, next] + branches: [main] paths: ["crates/menu/**", "crates/keymap/**", "crates/quit/**", "Cargo.toml", "Cargo.lock", ".github/workflows/menu.yml"] pull_request: paths: ["crates/menu/**", "crates/keymap/**", "crates/quit/**", "Cargo.toml", "Cargo.lock", ".github/workflows/menu.yml"] diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 5cc8032668..89d6344bc2 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -33,30 +33,3 @@ jobs: cache-key-files: scripts/ci-test-inputs.sh # The gate's build (the same targets and profile overrides), with every test at its full count. command: bash scripts/ci-workspace-tests.sh full - - # The scheduled run is main's; this starts the full tests above on next too, where the gate - # runs the same fractions. It also starts one Workspace run on next a day that nothing cancels - # (pull requests run the Linux legs only, and pushes to next cancel each other's runs): next's - # macOS and Windows legs then run in full at least once a day, and its Linux leg builds from - # source and saves next's own workspace-crates cache entry, which pull requests into next - # restore. Main gets the same from workspace.yml's own scheduled runs. The only job here with - # `actions: write`; it checks out and runs nothing from the repository. - workspace-next: - name: Workspace on next - if: github.event_name == 'schedule' - runs-on: ubuntu-latest - timeout-minutes: 5 - permissions: - actions: write - steps: - - name: Harden runner - uses: step-security/harden-runner@v2.22.4 - with: - egress-policy: audit - - name: Start the Workspace workflow and these full tests on next - env: - GH_TOKEN: ${{ github.token }} - REPO: ${{ github.repository }} - run: | - gh workflow run workspace.yml --repo "$REPO" --ref next - gh workflow run nightly.yml --repo "$REPO" --ref next diff --git a/.github/workflows/pcraft-format.yml b/.github/workflows/pcraft-format.yml index cefa5360c4..0e4feabc92 100644 --- a/.github/workflows/pcraft-format.yml +++ b/.github/workflows/pcraft-format.yml @@ -3,7 +3,7 @@ name: PhotoCraft format on: workflow_dispatch: push: - branches: [main, next] + branches: [main] paths: ['crates/pcraft-format/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/pcraft-format.yml'] pull_request: paths: ['crates/pcraft-format/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/pcraft-format.yml'] diff --git a/.github/workflows/pdf.yml b/.github/workflows/pdf.yml index 1550512ac5..0269fdc7ea 100644 --- a/.github/workflows/pdf.yml +++ b/.github/workflows/pdf.yml @@ -2,7 +2,7 @@ name: Shared PDF on: push: - branches: [main, next] + branches: [main] paths: ["crates/pdf/**", "crates/plate-test/**", "crates/prepress/**", "crates/cms/**", "vendor/hayro*/**", "vendor/krilla/**", "vendor/linesweeper/**", "vendor/vello_common/**", "vendor/vello_cpu/**", "scripts/test-pdf-backends.sh", "scripts/*fetch-pdf-test-fonts.py", "Cargo.toml", "Cargo.lock", ".github/workflows/pdf.yml"] pull_request: paths: ["crates/pdf/**", "crates/plate-test/**", "crates/prepress/**", "crates/cms/**", "vendor/hayro*/**", "vendor/krilla/**", "vendor/linesweeper/**", "vendor/vello_common/**", "vendor/vello_cpu/**", "scripts/test-pdf-backends.sh", "scripts/*fetch-pdf-test-fonts.py", "Cargo.toml", "Cargo.lock", ".github/workflows/pdf.yml"] diff --git a/.github/workflows/proof.yml b/.github/workflows/proof.yml index 0f5b869a4a..ea5edb8a56 100644 --- a/.github/workflows/proof.yml +++ b/.github/workflows/proof.yml @@ -2,7 +2,7 @@ name: Proofing on: push: - branches: [main, next] + branches: [main] paths: ["crates/proof/**", "Cargo.toml", "Cargo.lock", ".github/workflows/proof.yml"] pull_request: paths: ["crates/proof/**", "Cargo.toml", "Cargo.lock", ".github/workflows/proof.yml"] diff --git a/.github/workflows/theme.yml b/.github/workflows/theme.yml index 213a74b147..f0bb32a466 100644 --- a/.github/workflows/theme.yml +++ b/.github/workflows/theme.yml @@ -3,7 +3,7 @@ name: Suite themes on: workflow_dispatch: push: - branches: [main, next] + branches: [main] paths: ['crates/theme/**', 'crates/theme-store/**', 'crates/atomic/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/theme.yml'] pull_request: paths: ['crates/theme/**', 'crates/theme-store/**', 'crates/atomic/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/theme.yml'] diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 0ea3b8c1bb..e5e3e71d15 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -3,7 +3,7 @@ name: App updates on: workflow_dispatch: push: - branches: [main, next] + branches: [main] paths: ['crates/update/**', 'Cargo.toml', 'Cargo.lock', 'rustfmt.toml', 'clippy.toml', '.github/workflows/update.yml'] pull_request: paths: ['crates/update/**', 'Cargo.toml', 'Cargo.lock', 'rustfmt.toml', 'clippy.toml', '.github/workflows/update.yml'] diff --git a/.github/workflows/vectorcraft-format.yml b/.github/workflows/vectorcraft-format.yml index 0ca15636df..cd66615a50 100644 --- a/.github/workflows/vectorcraft-format.yml +++ b/.github/workflows/vectorcraft-format.yml @@ -3,7 +3,7 @@ name: VectorCraft format on: workflow_dispatch: push: - branches: [main, next] + branches: [main] paths: ['crates/vectorcraft-format/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/vectorcraft-format.yml'] pull_request: paths: ['crates/vectorcraft-format/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/vectorcraft-format.yml'] diff --git a/.github/workflows/video.yml b/.github/workflows/video.yml index 03b59cc427..20afe0d700 100644 --- a/.github/workflows/video.yml +++ b/.github/workflows/video.yml @@ -2,7 +2,7 @@ name: Shared video on: push: - branches: [main, next] + branches: [main] paths: ["crates/video/**", "crates/media/**", "crates/media-testkit/**", "Cargo.toml", "Cargo.lock", ".github/workflows/video.yml"] pull_request: paths: ["crates/video/**", "crates/media/**", "crates/media-testkit/**", "Cargo.toml", "Cargo.lock", ".github/workflows/video.yml"] diff --git a/.github/workflows/web-api.yml b/.github/workflows/web-api.yml index 0ad01e28fd..f0f8e22da7 100644 --- a/.github/workflows/web-api.yml +++ b/.github/workflows/web-api.yml @@ -3,7 +3,7 @@ name: Web API (page command API) on: workflow_dispatch: push: - branches: [main, next] + branches: [main] paths: ['crates/web-api/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/web-api.yml'] pull_request: paths: ['crates/web-api/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/web-api.yml'] diff --git a/.github/workflows/web-host.yml b/.github/workflows/web-host.yml index 055303bc26..dc0254850a 100644 --- a/.github/workflows/web-host.yml +++ b/.github/workflows/web-host.yml @@ -2,7 +2,7 @@ name: Shared web host on: push: - branches: [main, next] + branches: [main] paths: ["crates/web-host/**", "Cargo.toml", "Cargo.lock", ".github/workflows/web-host.yml"] pull_request: paths: ["crates/web-host/**", "Cargo.toml", "Cargo.lock", ".github/workflows/web-host.yml"] diff --git a/.github/workflows/window.yml b/.github/workflows/window.yml index a534393fdc..5f05883d14 100644 --- a/.github/workflows/window.yml +++ b/.github/workflows/window.yml @@ -3,7 +3,7 @@ name: Window decorations on: workflow_dispatch: push: - branches: [main, next] + branches: [main] paths: ['crates/window/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/window.yml'] pull_request: paths: ['crates/window/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/window.yml'] diff --git a/.github/workflows/workspace.yml b/.github/workflows/workspace.yml index 5c802e799e..b1a0ee2ffd 100644 --- a/.github/workflows/workspace.yml +++ b/.github/workflows/workspace.yml @@ -2,7 +2,7 @@ name: Workspace on: push: - branches: [main, next] + branches: [main] tags: ["v*"] pull_request: workflow_dispatch: @@ -16,13 +16,12 @@ permissions: contents: read concurrency: - # A pull request, main and next each have one group, so a newer push cancels the run it - # supersedes; the newest push's run still tests everything before it. Every other run (a release - # tag, a manual run, the scheduled run, nightly.yml's run on next) gets a group of its own and is - # neither cancelled nor replaced while queued: a release run always finishes, the scheduled run - # saves the caches, and next gets one complete macOS and Windows run a day. - group: workspace-${{ (github.event_name == 'pull_request' || github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'push' && github.ref == 'refs/heads/next') && github.ref || github.run_id }} - cancel-in-progress: ${{ github.event_name == 'pull_request' || github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'push' && github.ref == 'refs/heads/next' }} + # A pull request and main each have one group, so a newer push cancels the run it supersedes; the + # newest push's run still tests everything before it. Every other run (a release tag, a manual + # run, the scheduled run) gets a group of its own and is neither cancelled nor replaced while + # queued: a release run always finishes, and the scheduled run saves the caches. + group: workspace-${{ (github.event_name == 'pull_request' || github.event_name == 'push' && github.ref == 'refs/heads/main') && github.ref || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' || github.event_name == 'push' && github.ref == 'refs/heads/main' }} jobs: # Whether this run needs the macOS and Windows legs, and which tests every leg runs @@ -71,7 +70,7 @@ jobs: # The macOS and Windows legs cache dependencies only, so `deps-profile` hashes only the # settings that reach a dependency: `[profile.dev]` and `[profile.dev.package."*"]`. Every # other override names a workspace crate (scripts/test-workspace-tests.py), so changing one - # keeps those entries, and next's runs restore main's. + # keeps those entries. - uses: actions/checkout@v7.0.1 if: github.event_name != 'pull_request' with: @@ -104,13 +103,10 @@ jobs: # The Linux leg keeps the compiled workspace crates between runs (`cache-workspace-crates`): each # main run saves a rolling cache entry of its own, every run restores the newest one, and Cargo # rebuilds only the crates a change reaches. `cache-prune` keeps the newest entry. The midnight - # scheduled run builds from source (`cold-build`) and starts the entry afresh. next has an entry - # of its own, since main's is built from different code and lockfile and a pull request into next - # rebuilt nearly everything from it (15.5 minutes): nightly.yml's daily manual run on next builds - # from source and saves it (`cache-save-on-dispatch`), and pull requests into next restore it - # before main's. The macOS and Windows legs keep a dependency-only entry: their workspace crates - # would not fit the 10 GB cache budget beside Linux's. The lint legs keep no cache - # (`lint-cache: false`) for the same reason; a cold lint leg is still shorter than its gate leg. + # scheduled run builds from source (`cold-build`) and starts the entry afresh. The macOS and + # Windows legs keep a dependency-only entry: their workspace crates would not fit the 10 GB cache + # budget beside Linux's. The lint legs keep no cache (`lint-cache: false`) for the same reason; a + # cold lint leg is still shorter than its gate leg. native: name: Workspace needs: platforms @@ -118,9 +114,8 @@ jobs: with: os: '["ubuntu-latest"]' cache-workspace-crates: true - cache-save-on-dispatch: true cache-version: &cache-version v2-${{ needs.platforms.outputs.profile }} - cold-build: ${{ github.event.schedule == '17 0 * * *' || github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/next' }} + cold-build: ${{ github.event.schedule == '17 0 * * *' }} lint-cache: false # The vendored crates are on the workspace `exclude` list and craft-pdf's read-only contract is a # workspace of its own (pdf.yml tests it), so unreached-rs has no module tree for them. @@ -182,7 +177,7 @@ jobs: # The macOS and Windows legs, with the Linux leg's inputs. They take 1.5-2 hours against the Linux # leg's 15-40 minutes, so a pull request does not wait for them: they run after the merge, on - # every push to main and next, on main's scheduled runs and on nightly.yml's daily run on next. + # every push to main and on main's scheduled runs. # A pull request that needs them before it merges gets the full-ci label. native-platforms: name: Workspace @@ -192,7 +187,7 @@ jobs: with: os: '["windows-latest","macos-latest"]' lint-cache: false - # Named by the dependency settings alone (`deps-profile`), so next restores main's entries. + # Named by the dependency settings alone (`deps-profile`). cache-version: v2-${{ needs.platforms.outputs.deps-profile }} timeout-minutes: *timeout tools: *tools @@ -212,15 +207,14 @@ jobs: lint-command: *lint command: *command - # Each main run's Linux leg saves a rolling cache entry of its own (`cache-workspace-crates`), as - # does the daily manual run on next, and every run restores only the newest. This deletes the - # older ones of the run's branch as soon as the Linux leg is done, instead of leaving them to the - # 10 GB budget's eviction, which would evict other entries too. The only job with - # `actions: write`; it checks out and runs nothing from the repository. + # Each main run's Linux leg saves a rolling cache entry of its own (`cache-workspace-crates`), and + # every run restores only the newest. This deletes the older ones as soon as the Linux leg is + # done, instead of leaving them to the 10 GB budget's eviction, which would evict other entries + # too. The only job with `actions: write`; it checks out and runs nothing from the repository. cache-prune: name: cache prune needs: native - if: ${{ !cancelled() && github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/next') }} + if: ${{ !cancelled() && github.event_name != 'pull_request' && github.ref == 'refs/heads/main' }} runs-on: ubuntu-latest timeout-minutes: 5 permissions: @@ -234,11 +228,10 @@ jobs: env: GH_TOKEN: ${{ github.token }} REPO: ${{ github.repository }} - REF: ${{ github.ref }} run: | set -euo pipefail # `-rust---crates-----...`, newest first. - gh cache list --repo "$REPO" --ref "$REF" --limit 100 --sort created_at --order desc --json id,key \ + gh cache list --repo "$REPO" --ref refs/heads/main --limit 100 --sort created_at --order desc --json id,key \ --jq '.[] | "\(.id) \(.key)"' > "$RUNNER_TEMP/caches" declare -A kept while read -r id key; do diff --git a/scripts/test-workspace-concurrency.py b/scripts/test-workspace-concurrency.py index b8324eb0a2..dd5a29dd1c 100644 --- a/scripts/test-workspace-concurrency.py +++ b/scripts/test-workspace-concurrency.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -"""Check the Workspace workflow's cancellation policy: pull requests and pushes to main or next -cancel the run they supersede; release tags, manual runs and scheduled runs are never cancelled. +"""Check the Workspace workflow's cancellation policy: pull requests and pushes to main cancel +the run they supersede; release tags, manual runs and scheduled runs are never cancelled. The policy is the top-level `concurrency` block of .github/workflows/workspace.yml. This script reads those fields, requires the documented expression shapes, and checks which group each event @@ -32,7 +32,6 @@ PULL_REQUEST, PUSH, DISPATCH, SCHEDULE = "pull_request", "push", "workflow_dispa SUPERSEDED = ( "github.event_name == 'pull_request'" " || github.event_name == 'push' && github.ref == 'refs/heads/main'" - " || github.event_name == 'push' && github.ref == 'refs/heads/next'" ) GROUP_SHAPE = re.compile( r"(?P[A-Za-z0-9._-]+)-\$\{\{\s*\(\s*(?P[^()]+?)\s*\)\s*" @@ -47,7 +46,7 @@ def normal(expression): def superseded(event_name, ref): """SUPERSEDED, evaluated.""" - return event_name == PULL_REQUEST or (event_name == PUSH and ref in ("refs/heads/main", "refs/heads/next")) + return event_name == PULL_REQUEST or (event_name == PUSH and ref == "refs/heads/main") def read_concurrency(text): @@ -86,11 +85,10 @@ def other_run(event_name, ref, run_id): return (event_name, ref, run_id) -MAIN, NEXT, TAG = ("refs/heads/main", "refs/heads/next", "refs/tags/v1.2.3") +MAIN, TAG = ("refs/heads/main", "refs/tags/v1.2.3") SAME_GROUP = [ ("a newer commit on the same pull request", pull_request(1316, 43599251877), pull_request(1316, 43600899878)), ("two pushes to main", other_run(PUSH, MAIN, 3), other_run(PUSH, MAIN, 4)), - ("two pushes to next", other_run(PUSH, NEXT, 20), other_run(PUSH, NEXT, 21)), ] DIFFERENT_GROUPS = [ ("two pull requests", pull_request(1316, 1), pull_request(1317, 1)), @@ -101,15 +99,11 @@ DIFFERENT_GROUPS = [ ("a main push and a scheduled run", other_run(PUSH, MAIN, 17), other_run(SCHEDULE, MAIN, 17)), ("a main push and a manual run of main", other_run(PUSH, MAIN, 18), other_run(DISPATCH, MAIN, 18)), ("a main push and a pull request", other_run(PUSH, MAIN, 9), pull_request(1316, 9)), - ("a main push and a next push", other_run(PUSH, MAIN, 22), other_run(PUSH, NEXT, 22)), - ("a next push and the nightly manual run of next", other_run(PUSH, NEXT, 23), other_run(DISPATCH, NEXT, 23)), ("a release tag and a pull request", other_run(PUSH, TAG, 10), pull_request(1316, 10)), ] CANCELLATION = [ ("a push supersedes the previous run of its pull request", pull_request(1316, 11), True), ("a push to main supersedes the previous main run", other_run(PUSH, MAIN, 12), True), - ("a push to next supersedes the previous next run", other_run(PUSH, NEXT, 24), True), - ("the nightly manual run of next is never cancelled", other_run(DISPATCH, NEXT, 25), False), ("a release tag run is never cancelled", other_run(PUSH, TAG, 13), False), ("a manual run is never cancelled", other_run(DISPATCH, MAIN, 14), False), ("the scheduled run that saves the caches is never cancelled", other_run(SCHEDULE, MAIN, 19), False), @@ -158,7 +152,7 @@ class ConcurrencyTests(unittest.TestCase): with self.subTest(description): self.assertNotEqual(self.group(*first), self.group(*second), description) - def test_only_pull_requests_and_main_and_next_pushes_cancel(self): + def test_only_pull_requests_and_main_pushes_cancel(self): for description, context, expected in CANCELLATION: with self.subTest(description): self.assertEqual(self.cancels(context[0], context[1]), expected, description) diff --git a/scripts/test-workspace-tests.py b/scripts/test-workspace-tests.py index 5cceeddc1b..9a926eb5a6 100644 --- a/scripts/test-workspace-tests.py +++ b/scripts/test-workspace-tests.py @@ -318,7 +318,7 @@ class WorkspaceTests(unittest.TestCase): self.assertIn("test-shards: ${{ needs.platforms.outputs.audit == 'true' && 3 || 0 }}", source) # The Linux leg's entry, which keeps workspace crates, is named after every profile override; # the macOS and Windows legs' dependency-only entries after the settings that reach a - # dependency, so next restores main's (test_profile_overrides_name_only_workspace_members). + # dependency (test_profile_overrides_name_only_workspace_members). self.assertIn("cache-version: &cache-version v2-${{ needs.platforms.outputs.profile }}\n", source) self.assertIn(" cache-version: v2-${{ needs.platforms.outputs.deps-profile }}\n", source) self.assertIn(" deps-profile: ${{ steps.audit.outputs.deps-profile }}\n", source)