55 branches :
66 - main
77 - ' patch-release-*'
8+ - boringcache
89
910name : Continuous Integration
1011
1617 NU_LOG_LEVEL : DEBUG
1718 NU_TEST_SKIP_DEPS_BUILD : true
1819 NUSHELL_CARGO_PROFILE : ci
20+ CARGO_INCREMENTAL : " 1"
1921
2022concurrency :
2123 group : ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
3335 github.event.pull_request.stack.position ==
3436 github.event.pull_request.stack.size
3537 )
38+ permissions :
39+ contents : read
40+ id-token : write
3641 env :
3742 build-target : ${{ matrix.platform.target }}
3843 working-directory : ${{ github.workspace }}
@@ -42,16 +47,25 @@ jobs:
4247 matrix :
4348 platform : &platforms
4449 - name : Linux
45- runner : &runner_linux incredibuild- ubuntu-2204
50+ runner : &runner_linux ubuntu-22.04
4651 target : &target_linux x86_64-unknown-linux-gnu
4752 - name : Windows
4853 runner : &runner_windows incredibuild-windows-2022
4954 target : &target_windows x86_64-pc-windows-msvc
5055 - name : MacOS
51- runner : &runner_macos incredibuild- macos-latest
52- target : &target_macos x86_64 -apple-darwin
56+ runner : &runner_macos macos-15
57+ target : &target_macos aarch64 -apple-darwin
5358 steps :
5459
60+ - name : Runner Hardware
61+ shell : bash
62+ run : |
63+ case "$RUNNER_OS" in
64+ Linux) lscpu | grep -E '^(Model name|CPU\(s\)):'; free -h | head -2 ;;
65+ macOS) sysctl -n machdep.cpu.brand_string hw.ncpu hw.memsize ;;
66+ Windows) powershell -NoProfile -Command 'Get-CimInstance Win32_Processor | Format-List Name,NumberOfCores,NumberOfLogicalProcessors; Get-CimInstance Win32_ComputerSystem | Format-List TotalPhysicalMemory' ;;
67+ esac
68+
5569 - &step_checkout_repo
5670 name : Checkout Repo
5771 uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
@@ -61,40 +75,49 @@ jobs:
6175 run : rustup target add ${{ env.build-target }}
6276 working-directory : ${{ env.working-directory }}
6377
64- - &step_cache_rust
78+ - &step_cache_boringcache
6579 name : Cache Rust
66- uses : Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
80+ uses : boringcache/one@1781572d7b3ec5aef652f8ba479b981439b2776b # v1.48.2
6781 with :
68- workspaces : ${{ env.working-directory }} -> target
69- cache-all-crates : true
70- # Workspace crates are recompiled after an exact cache hit anyway (fingerprint
71- # mismatch), while restoring them dominates Cache Rust on Windows (~2.8 GB, ~54s).
72- # Cache dependencies only so restores stay small and useful.
73- cache-workspace-crates : false
82+ mode : cargo
83+ working-directory : ${{ env.working-directory }}
7484
7585 # Fmt and Clippy run in the parallel lint job so they stay off the build/test critical path.
7686
7787 - &step_build
7888 name : Build
7989 working-directory : ${{ env.working-directory }}
8090 run : >-
81- cargo --config "${{ github.workspace }}/.cargo/ci.toml"
91+ boringcache cargo --verbose --profile cargo-target
92+ --target-scope "root-${{ github.run_id }}-${{ github.run_attempt }}" --skip-restore --skip-save --
93+ --config "${{ github.workspace }}/.cargo/ci.toml"
8294 build ${{ env.cargo-options }}
8395 --profile ${{ env.profile }}
8496
8597 - &step_test
8698 name : Test
8799 working-directory : ${{ env.working-directory }}
88100 run : >-
89- cargo --config "${{ github.workspace }}/.cargo/ci.toml"
101+ boringcache cargo --verbose --profile cargo-target
102+ --target-scope "root-${{ github.run_id }}-${{ github.run_attempt }}" --skip-restore --skip-save --
103+ --config "${{ github.workspace }}/.cargo/ci.toml"
90104 test ${{ env.cargo-options }}
91105 --profile ${{ env.profile }}
92106
107+ - name : Plugin process state on Linux failure
108+ if : failure() && runner.os == 'Linux'
109+ shell : bash
110+ run : >-
111+ ps -eo pid,ppid,stat,etimes,comm |
112+ awk 'NR == 1 || $1 == 1 || $5 == "nu_plugin_inc"'
113+
93114 - &step_doctest
94115 name : Doctest
95116 working-directory : ${{ env.working-directory }}
96117 run : >-
97- cargo --config "${{ github.workspace }}/.cargo/ci.toml"
118+ boringcache cargo --verbose --profile cargo-target
119+ --target-scope "root-${{ github.run_id }}-${{ github.run_attempt }}" --skip-restore --skip-save --
120+ --config "${{ github.workspace }}/.cargo/ci.toml"
98121 test --workspace --doc
99122 --profile ${{ env.profile }}
100123
@@ -155,6 +178,9 @@ jobs:
155178 name : ${{ matrix.platform.name }} / lint
156179 runs-on : ${{ matrix.platform.runner }}
157180 if : *job_if
181+ permissions :
182+ contents : read
183+ id-token : write
158184 env :
159185 build-target : ${{ matrix.platform.target }}
160186 working-directory : ${{ github.workspace }}
@@ -166,7 +192,13 @@ jobs:
166192 steps :
167193 - *step_checkout_repo
168194 - *step_setup_rust_toolchain
169- - *step_cache_rust
195+
196+ - name : Cache Rust
197+ uses : boringcache/one@1781572d7b3ec5aef652f8ba479b981439b2776b # v1.48.2
198+ with :
199+ mode : archive
200+ cache-profiles : lint-deps
201+ working-directory : ${{ env.working-directory }}
170202
171203 - &step_fmt
172204 name : Fmt
@@ -175,16 +207,17 @@ jobs:
175207 rustup component add rustfmt
176208 cargo fmt --all --check
177209
178- - &step_clippy
179- name : Clippy
210+ - name : Clippy
211+ shell : bash
180212 env :
181213 CARGO_BUILD_WARNINGS : deny
182214 working-directory : ${{ env.working-directory }}
183215 run : >-
184216 rustup component add clippy
185217
186- cargo --config "${{ github.workspace }}/.cargo/ci.toml"
187- clippy ${{ env.cargo-options }}
218+ boringcache cargo --verbose --profile lint-target --
219+ --config "${{ github.workspace }}/.cargo/ci.toml"
220+ clippy ${{ env.cargo-options }}
188221 --profile ${{ env.profile }}
189222
190223 - *step_assert_clean_repo
@@ -193,6 +226,9 @@ jobs:
193226 name : WASM / root
194227 runs-on : *runner_linux
195228 if : *job_if
229+ permissions :
230+ contents : read
231+ id-token : write
196232 env :
197233 build-target : wasm32-unknown-unknown
198234 working-directory : ${{ github.workspace }}
@@ -222,21 +258,41 @@ jobs:
222258 steps :
223259 - *step_checkout_repo
224260 - *step_setup_rust_toolchain
225- - *step_cache_rust
261+ - name : Cache Rust
262+ uses : boringcache/one@1781572d7b3ec5aef652f8ba479b981439b2776b # v1.48.2
263+ with :
264+ mode : archive
265+ cache-profiles : wasm-deps
266+ working-directory : ${{ env.working-directory }}
226267 - name : Check
268+ shell : bash
227269 working-directory : ${{ env.working-directory }}
228270 run : >-
229- cargo --config "${{ github.workspace }}/.cargo/ci.toml"
271+ boringcache cargo --verbose --profile wasm-target
272+ --target-scope "wasm-${{ github.run_id }}-${{ github.run_attempt }}" --skip-save --
273+ --config "${{ github.workspace }}/.cargo/ci.toml"
230274 check ${{ env.cargo-options }}
231275 --profile ${{ env.profile }}
232276
233- - *step_build
277+ - name : Build
278+ shell : bash
279+ working-directory : ${{ env.working-directory }}
280+ run : >-
281+ boringcache cargo --verbose --profile wasm-target
282+ --target-scope "wasm-${{ github.run_id }}-${{ github.run_attempt }}" --skip-restore --
283+ --config "${{ github.workspace }}/.cargo/ci.toml"
284+ build ${{ env.cargo-options }}
285+ --profile ${{ env.profile }}
286+
234287 - *step_assert_clean_repo
235288
236289 fuzz :
237290 name : ${{ matrix.platform.name }} / ${{ matrix.crate }} / fuzz
238291 runs-on : ${{ matrix.platform.runner }}
239292 if : *job_if
293+ permissions :
294+ contents : read
295+ id-token : write
240296 env :
241297 build-target : ${{ matrix.platform.target }}
242298 working-directory : ${{ github.workspace }}/crates/${{ matrix.crate }}/fuzz
@@ -251,7 +307,18 @@ jobs:
251307 steps :
252308 - *step_checkout_repo
253309 - *step_setup_rust_toolchain
254- - *step_cache_rust
310+ - *step_cache_boringcache
255311 - *step_fmt
256- - *step_clippy
312+ - &step_clippy
313+ name : Clippy
314+ env :
315+ CARGO_BUILD_WARNINGS : deny
316+ working-directory : ${{ env.working-directory }}
317+ run : >-
318+ rustup component add clippy
319+
320+ boringcache cargo --verbose --profile cargo-target --skip-restore --skip-save --
321+ --config "${{ github.workspace }}/.cargo/ci.toml"
322+ clippy ${{ env.cargo-options }}
323+ --profile ${{ env.profile }}
257324 - *step_assert_clean_repo
0 commit comments