2121 - name : Checkout
2222 uses : actions/checkout@v6
2323 with :
24- fetch-depth : 0
24+ fetch-depth : 100
25+
26+ - name : Run pull request checks
27+ if : github.event_name == 'pull_request'
28+ shell : bash
29+ run : |
30+ source .github/ci.env
31+ commits=${{ github.event.pull_request.commits }}
32+ if [ "${commits}" -gt "${MAX_PR_COMMITS}" ]; then
33+ echo "::error::PR has ${commits} commits (limit: ${MAX_PR_COMMITS})"
34+ exit 1
35+ fi
2536
2637 - name : Install Rust toolchain
2738 uses : dtolnay/rust-toolchain@1.85.0
@@ -57,27 +68,23 @@ jobs:
5768 key : cargo-deps-${{ hashFiles('Cargo.lock') }}
5869 restore-keys : cargo-deps-
5970
60- - name : Restore CodeQL caches
61- id : codeql-cache
71+ - name : Restore build artifacts
6272 uses : actions/cache/restore@v5
6373 with :
64- path : |
65- contrib/codeql/.cache
66- ~/.codeql
67- key : codeql-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pkgs/**/*.rs', 'contrib/codeql/**/*.ql', 'contrib/codeql/**/*.qll', 'Cargo.lock') }}
74+ path : target
75+ key : cargo-build-msrv-${{ runner.os }}-${{ runner.arch }}-${{ github.sha }}
76+ restore-keys : |
77+ cargo-build-msrv-${{ runner.os }}-${{ runner.arch }}-
78+
79+ - name : Manage CodeQL packs
80+ uses : actions/cache@v5
81+ with :
82+ path : ~/.codeql
83+ key : codeql-packs-${{ hashFiles('contrib/codeql/codeql-pack.lock.yml') }}
6884
6985 - name : Run linters
7086 run : python3 contrib/lint/all_lint.py
7187
72- - name : Save CodeQL caches
73- if : success() && steps.codeql-cache.outputs.cache-hit != 'true'
74- uses : actions/cache/save@v5
75- with :
76- path : |
77- contrib/codeql/.cache
78- ~/.codeql
79- key : codeql-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pkgs/**/*.rs', 'contrib/codeql/**/*.ql', 'contrib/codeql/**/*.qll', 'Cargo.lock') }}
80-
8188 - name : Check PR commit messages
8289 if : github.event_name == 'pull_request'
8390 run : >
@@ -86,11 +93,24 @@ jobs:
8693
8794 build :
8895 name : Build and test
89- runs-on : ubuntu-24.04
96+ runs-on : ubuntu-24.04-arm
9097
9198 steps :
9299 - name : Checkout
93100 uses : actions/checkout@v6
101+ with :
102+ fetch-depth : 1
103+
104+ - name : Run pull request checks
105+ if : github.event_name == 'pull_request'
106+ shell : bash
107+ run : |
108+ source .github/ci.env
109+ commits=${{ github.event.pull_request.commits }}
110+ if [ "${commits}" -gt "${MAX_PR_COMMITS}" ]; then
111+ echo "::error::PR has ${commits} commits (limit: ${MAX_PR_COMMITS})"
112+ exit 1
113+ fi
94114
95115 - name : Install Rust toolchain
96116 uses : dtolnay/rust-toolchain@1.85.0
@@ -104,6 +124,14 @@ jobs:
104124 key : cargo-deps-${{ hashFiles('Cargo.lock') }}
105125 restore-keys : cargo-deps-
106126
127+ - name : Manage build artifacts
128+ uses : actions/cache@v5
129+ with :
130+ path : target
131+ key : cargo-build-msrv-${{ runner.os }}-${{ runner.arch }}-${{ github.sha }}
132+ restore-keys : |
133+ cargo-build-msrv-${{ runner.os }}-${{ runner.arch }}-
134+
107135 - name : Build workspace
108136 run : cargo build --workspace --features full,_internal
109137
0 commit comments