Skip to content

Commit 6124273

Browse files
committed
Cache Windows builds harder
1 parent 6413deb commit 6124273

1 file changed

Lines changed: 22 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
run: cargo doc --no-deps -p boring -p boring-sys -p hyper-boring -p tokio-boring --features rpk,underscore-wildcards
6464
env:
6565
CARGO_BUILD_RUSTDOCFLAGS: "--cfg=docsrs"
66-
RUST_BOOTSTRAP: 1
66+
RUSTC_BOOTSTRAP: 1
6767
DOCS_RS: 1
6868
- name: Cargo.toml boring versions consistency
6969
shell: bash
@@ -195,32 +195,37 @@ jobs:
195195
C_INCLUDE_PATH: "C:\\msys64\\usr\\include"
196196
CPLUS_INCLUDE_PATH: "C:\\msys64\\usr\\include"
197197
LIBRARY_PATH: "C:\\msys64\\usr\\lib"
198+
RUSTC_BOOTSTRAP: 1 # for -Z checksum-freshness
198199
# CI's Windows doesn't have required root certs
199-
extra_test_args: --workspace --exclude tokio-boring --exclude hyper-boring
200+
extra_test_args: --workspace --exclude tokio-boring --exclude hyper-boring -Z checksum-freshness
200201
- thing: i686-mingw
201202
target: i686-pc-windows-gnu
202203
rust: stable
203204
os: windows-latest
204205
check_only: true
205206
custom_env:
207+
RUSTC_BOOTSTRAP: 1 # for -Z checksum-freshness
206208
CMAKE_GENERATOR: "MinGW Makefiles"
207209
COLLECT_GCC: null
208210
# CI's Windows doesn't have required root certs
209-
extra_test_args: --workspace --exclude tokio-boring --exclude hyper-boring
211+
extra_test_args: --workspace --exclude tokio-boring --exclude hyper-boring -Z checksum-freshness
210212
- thing: i686-msvc
211213
target: i686-pc-windows-msvc
212214
rust: stable-x86_64-msvc
213215
os: windows-latest
214216
custom_env:
217+
RUSTC_BOOTSTRAP: 1 # for -Z checksum-freshness
215218
CXXFLAGS: -msse2
216219
# CI's Windows doesn't have required root certs
217-
extra_test_args: --workspace --exclude tokio-boring --exclude hyper-boring
220+
extra_test_args: --workspace --exclude tokio-boring --exclude hyper-boring -Z checksum-freshness
218221
- thing: x86_64-msvc
219222
target: x86_64-pc-windows-msvc
220223
rust: stable-x86_64-msvc
221224
os: windows-latest
225+
custom_env:
226+
RUSTC_BOOTSTRAP: 1 # for -Z checksum-freshness
222227
# CI's Windows doesn't have required root certs
223-
extra_test_args: --workspace --exclude tokio-boring --exclude hyper-boring
228+
extra_test_args: --workspace --exclude tokio-boring --exclude hyper-boring -Z checksum-freshness
224229
env:
225230
CARGO_HOME: ${{ github.workspace }}/.cache/cargo
226231
CARGO_BUILD_BUILD_DIR: ${{ github.workspace }}/.cache/build-dir
@@ -301,15 +306,23 @@ jobs:
301306
# Windows builds are the slowest
302307
- name: Cache deps in Windows tests
303308
if: startsWith(matrix.os, 'windows')
304-
uses: actions/cache@v4
309+
uses: actions/cache/restore@v4
310+
id: test-cache-restore
305311
with:
306-
path: .cache/build-dir # CARGO_BUILD_BUILD_DIR
307-
key: test-${{ matrix.target }}-${{ hashFiles('Cargo.lock') }}
312+
path: .cache/build-dir
313+
key: wintest-${{ matrix.target }}-${{ hashFiles('Cargo.lock') }}
308314
- name: Build tests
309315
# We `build` because we want the linker to verify we are cross-compiling correctly for check-only targets.
310-
run: cargo build -v --target ${{ matrix.target }} --tests ${{ matrix.extra_test_args }}
316+
run: cargo build -vv --target ${{ matrix.target }} --tests ${{ matrix.extra_test_args }}
311317
shell: bash
312318
env: ${{ matrix.custom_env }}
319+
# By default it'd be saved after later cargo calls, which already invalidated the cache
320+
- name: Cache deps in Windows tests
321+
if: startsWith(matrix.os, 'windows')
322+
uses: actions/cache/save@v4
323+
with:
324+
path: .cache/build-dir
325+
key: ${{ steps.test-cache-restore.outputs.cache-primary-key }}
313326
- name: Run tests (skip=${{ matrix.check_only }})
314327
if: "!matrix.check_only"
315328
run: cargo test --target ${{ matrix.target }} ${{ matrix.extra_test_args }}

0 commit comments

Comments
 (0)