Skip to content

Commit 1fc00d8

Browse files
committed
Cached index in tests
1 parent 60707c5 commit 1fc00d8

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,23 @@ jobs:
221221
- name: Set Android Linker path
222222
if: endsWith(matrix.thing, '-android')
223223
run: echo "CARGO_TARGET_$(echo ${{ matrix.target }} | tr \\-a-z _A-Z)_LINKER=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/$(echo ${{ matrix.target }} | sed s/armv7/armv7a/)21-clang++" >> "$GITHUB_ENV"
224+
- name: Get rust version
225+
id: rust-version
226+
run: |
227+
echo "version=$(rustc --version)" >> $GITHUB_OUTPUT
228+
- name: Prepopulate cargo index
229+
uses: actions/cache/restore@v4
230+
with:
231+
path: |
232+
~/.cargo/registry/index
233+
~/.cargo/registry/cache
234+
key: index-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.toml') }}
224235
- name: Build tests
225236
# We `build` because we want the linker to verify we are cross-compiling correctly for check-only targets.
226237
run: cargo build --target ${{ matrix.target }} --tests ${{ matrix.extra_test_args }}
227238
shell: bash
228239
env: ${{ matrix.custom_env }}
229-
- name: Run tests
240+
- name: Run tests (skip=${{ matrix.check_only }})
230241
if: "!matrix.check_only"
231242
run: cargo test --target ${{ matrix.target }} ${{ matrix.extra_test_args }}
232243
shell: bash

0 commit comments

Comments
 (0)