From 87e0c8a7da1e06ec76f0eb83ae3600e72f09db81 Mon Sep 17 00:00:00 2001 From: aiongg <67543387+aiongg@users.noreply.github.com> Date: Fri, 23 Oct 2026 14:31:08 -0400 Subject: [PATCH] CI: shared gate workflow; FreeBSD nightly and on release (#1206) * CI: run the gate through craft-common-actions' shared gate.yml; FreeBSD nightly and on release ci.yml calls the shared workflow (cached apt packages, nextest, main-only cache saves, Cargo.lock check). FreeBSD runs nightly and on pushes to release instead of on pull requests. Depends on storytold/craft-common-actions#69. * CI: build the shared gate without craft-fonts, as before * CI: build the shared gate with release.yml's craft-fonts pin --- .github/workflows/ci.yml | 89 +++++++---------------------------- .github/workflows/freebsd.yml | 10 ++-- 2 files changed, 21 insertions(+), 78 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3dfa31d9..1968076f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,7 @@ -# CI for pull requests and main: format, clippy, tests, dependency layering, asset attribution and -# the wasm32 check (the same gates as `cargo xtask ci`). Linux only: macOS is built and tested only -# by release.yml (the org's macOS runners are kept for releases; craftrules release/playbook.md), -# and Windows/FreeBSD packaging have their own workflows. name: CI +# Quality gates for every push to main and every pull request (`cargo xtask ci`), through the +# suite's shared gate workflow in craft-common-actions. on: push: branches: [main] @@ -13,76 +11,21 @@ on: permissions: contents: read -env: - CARGO_TERM_COLOR: always - CARGO_INCREMENTAL: 0 - RUST_BACKTRACE: 1 - # Debug and test builds keep line tables (file:line in panic backtraces) but drop the rest of the - # debug info: faster codegen and links, and a smaller target dir. - CARGO_PROFILE_DEV_DEBUG: line-tables-only - -# A newer push to a PR branch cancels its older run. Runs on main are never cancelled, so every -# main state that gets a run is checked to the end. +# A newer push to a PR branch cancels its older run; every push to main runs to the end. concurrency: - group: ci-${{ github.ref }} + group: ci-${{ github.event_name == 'pull_request' && github.ref || github.run_id }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: - test: - timeout-minutes: 35 - name: test (ubuntu-latest) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v7 - - - name: Install Linux system dependencies (egui/winit/rfd) - run: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends \ - libxkbcommon-dev libwayland-dev libx11-dev libxrandr-dev libxi-dev \ - libgl1-mesa-dev libgtk-3-dev - - - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable - with: - components: clippy, rustfmt - - # Only main saves caches; PRs restore main's, so PR caches don't evict main's. - - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 - with: - save-if: ${{ github.ref == 'refs/heads/main' }} - cache-on-failure: true - - - name: Format - run: cargo fmt --all -- --check - - - name: Clippy - run: cargo clippy --workspace --all-targets --locked -- -D warnings - - # Without craft-fonts (the optional CRAFT_FONTS_DIR input, which .cargo/config.toml points at - # a sibling checkout that CI doesn't have): everything must build and pass without it. - - name: Test - run: cargo test --workspace --locked - - - name: Dependency layering - run: cargo run --locked -q -p xtask -- layers - - - name: Asset attribution - run: cargo run --locked -q -p xtask -- assets - - wasm: - timeout-minutes: 30 - name: wasm32 check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v7 - - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable - with: - targets: wasm32-unknown-unknown - - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 - with: - key: wasm32 - save-if: ${{ github.ref == 'refs/heads/main' }} - cache-on-failure: true - # The engine, the UI crate and apps/figcraft-web must keep compiling for the browser. - - name: Check wasm-safe crates - run: cargo run --locked -q -p xtask -- wasm + gate: + # Tracks @main so suite-wide CI fixes reach every app without a PR in each repository. + uses: storytold/craft-common-actions/.github/workflows/gate.yml@main + with: + # The craft-fonts commit release.yml builds with. Needs fonts/latin-manifest.txt (Inter): + # crates/text/build.rs fails a build that requires craft-fonts without it. Only craft-fonts' + # pr/latin-presentation-fonts has it; its main has Noto Sans Georgian but no Inter. Re-pin + # once one commit has both (storytold/craft-fonts#42). + craft-fonts-ref: 43913056ce82a3fdad0ef69f6b88d1dc922a8104 + packages: >- + libxkbcommon-dev libwayland-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev + libgtk-3-dev diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml index ff15bfbc..3b03a99c 100644 --- a/.github/workflows/freebsd.yml +++ b/.github/workflows/freebsd.yml @@ -4,12 +4,10 @@ # before it can fail a release. Nothing is uploaded and no secrets are used. name: FreeBSD -# The VM build takes one to several hours, so it runs nightly on main rather than on every push -# or dependency change: a drifted dependency still shows up within a day. PRs that change the -# FreeBSD packaging itself still run it. +# The VM build is slow, so it runs nightly on main and on pushes to `release`, not on every pull +# request: a drifted dependency still shows up within a day, and always before a release ships. +# PRs that change the FreeBSD workflow or packaging itself still run it. on: - schedule: - - cron: "17 2 * * *" push: branches: [release] pull_request: @@ -17,6 +15,8 @@ on: - .github/workflows/freebsd.yml - packaging/freebsd/** - packaging/env.sh + schedule: + - cron: "17 2 * * *" workflow_dispatch: concurrency: