|
1 | | -name: ci |
| 1 | +name: CI |
2 | 2 |
|
3 | | -# Quality gates for every push to main and every pull request: rustfmt, clippy (-D warnings), |
4 | | -# tests, asset attribution, crate layering and the wasm32 check — `cargo xtask ci`. |
| 3 | +# Quality gates for every push to main and every pull request (`cargo xtask ci`), through the |
| 4 | +# suite's shared gate workflow in craft-common-actions. |
5 | 5 | on: |
6 | 6 | push: |
7 | 7 | branches: [main] |
8 | 8 | pull_request: |
9 | 9 | workflow_dispatch: |
10 | 10 |
|
11 | | -concurrency: |
12 | | - group: ci-${{ github.ref }} |
13 | | - cancel-in-progress: true |
| 11 | +permissions: |
| 12 | + contents: read |
14 | 13 |
|
15 | | -env: |
16 | | - CARGO_TERM_COLOR: always |
17 | | - # Same craft-fonts commit as release.yml (Latin presentation fonts). |
18 | | - CRAFT_FONTS_REF: 43913056ce82a3fdad0ef69f6b88d1dc922a8104 |
| 14 | +# A newer push to a PR branch cancels its older run; every push to main runs to the end. |
| 15 | +concurrency: |
| 16 | + group: ci-${{ github.event_name == 'pull_request' && github.ref || github.run_id }} |
| 17 | + cancel-in-progress: ${{ github.event_name == 'pull_request' }} |
19 | 18 |
|
20 | 19 | jobs: |
21 | | - gates: |
22 | | - name: gates (${{ matrix.os }}) |
23 | | - strategy: |
24 | | - fail-fast: false |
25 | | - matrix: |
26 | | - # No macOS on PRs or main: the org's 5 macOS slots are kept for release builds, and |
27 | | - # release.yml builds macOS (a failing release is fixed and rebuilt). |
28 | | - os: [ubuntu-latest] |
29 | | - runs-on: ${{ matrix.os }} |
| 20 | + # Keep the early manifest preflight separate from the reusable workflow. The shared gate |
| 21 | + # also runs with require-craft-fonts: true, so the build script enforces actual required faces. |
| 22 | + # Keep this pin identical to gate, freebsd.yml and release.yml. |
| 23 | + font-pin: |
| 24 | + runs-on: ubuntu-latest |
| 25 | + env: |
| 26 | + # Same craft-fonts commit as release.yml. |
| 27 | + CRAFT_FONTS_REF: 37827adc41fd165f9a9234ac40f94dbad353aa69 |
30 | 28 | steps: |
31 | | - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
32 | 29 | - name: Check out craft-fonts |
33 | 30 | uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
34 | 31 | with: |
35 | 32 | repository: storytold/craft-fonts |
36 | 33 | ref: ${{ env.CRAFT_FONTS_REF }} |
37 | 34 | path: craft-fonts |
38 | | - - name: Linux build dependencies |
39 | | - if: runner.os == 'Linux' |
40 | | - run: | |
41 | | - sudo apt-get update |
42 | | - sudo apt-get install -y --no-install-recommends \ |
43 | | - libasound2-dev libxkbcommon-dev libwayland-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev |
44 | | - - uses: dtolnay/rust-toolchain@686976e191b89faba57d3206551f0f330d8cb249 # stable |
45 | | - with: |
46 | | - components: rustfmt, clippy |
47 | | - targets: wasm32-unknown-unknown |
48 | | - - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 |
49 | | - with: |
50 | | - key: ci-${{ matrix.os }} |
51 | | - - name: cargo xtask ci |
| 35 | + - name: Font pin gate |
52 | 36 | env: |
53 | | - CRAFT_FONTS_DIR: ${{ github.workspace }}/craft-fonts |
54 | | - run: cargo xtask ci |
| 37 | + # The only pin allowed to predate the reviewed Chinese manifest. It is a sentinel, not |
| 38 | + # a proposed future SHA; update it together with all three workflow pins. |
| 39 | + PENDING_CRAFT_FONTS_PIN: 43913056ce82a3fdad0ef69f6b88d1dc922a8104 |
| 40 | + run: | |
| 41 | + manifest="$GITHUB_WORKSPACE/craft-fonts/fonts/simplified-chinese-manifest.txt" |
| 42 | + if [ -f "$manifest" ]; then |
| 43 | + echo "craft-fonts pin carries the reviewed simplified-Chinese manifest." |
| 44 | + elif [ "$CRAFT_FONTS_REF" = "$PENDING_CRAFT_FONTS_PIN" ]; then |
| 45 | + echo "::warning title=craft-fonts pin pending::The pinned craft-fonts commit has no fonts/simplified-chinese-manifest.txt, so CJK checks may skip. Advance ci.yml, freebsd.yml and release.yml together to the reviewed immutable SHA before claiming shipped Chinese fonts." |
| 46 | + else |
| 47 | + echo "::error title=craft-fonts pin missing Chinese manifest::CRAFT_FONTS_REF advanced past the known pending pin ($PENDING_CRAFT_FONTS_PIN) but still has no fonts/simplified-chinese-manifest.txt. Update the pin to the reviewed commit that carries it." |
| 48 | + exit 1 |
| 49 | + fi |
| 50 | +
|
| 51 | + gate: |
| 52 | + needs: font-pin |
| 53 | + # Tracks @main so suite-wide CI fixes reach every app without a PR in each repository. |
| 54 | + uses: storytold/craft-common-actions/.github/workflows/gate.yml@main |
| 55 | + with: |
| 56 | + # Same craft-fonts commit as release.yml. |
| 57 | + craft-fonts-ref: 37827adc41fd165f9a9234ac40f94dbad353aa69 |
| 58 | + require-craft-fonts: true |
| 59 | + packages: >- |
| 60 | + libasound2-dev libxkbcommon-dev libwayland-dev libx11-dev libxrandr-dev libxi-dev |
| 61 | + libgl1-mesa-dev |
0 commit comments