Skip to content

Commit

Permalink
CI: Set up explicit cache keys to share cache with exhaustive build.
Browse files Browse the repository at this point in the history
Also upgrade rust-cache action to 2.7.0.
  • Loading branch information
kpreid committed Nov 13, 2023
1 parent ef9fec3 commit f05d054
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 10 deletions.
31 changes: 24 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,14 @@ jobs:
- run: df -h .

# Load cache before doing any Rust builds
- uses: Swatinem/[email protected]
- uses: Swatinem/[email protected]
with:
# This is not necessary for keying, but makes the GHA cache viewing page more helpful.
prefix-key: "v1-rust-build-${{ matrix.os }}-${{ matrix.toolchain }}-${{ matrix.depversions }}"
# Override the default job-id-based key explicitly so that our dependent jobs can
# reuse this cache.
shared-key: "build"


- run: df -h .

Expand Down Expand Up @@ -245,8 +252,13 @@ jobs:
# libasound2-dev: needed for audio via `kira`

# Load cache before doing any Rust builds
# TODO: Do we actually want to cache this, or let it be slow but low storage?
- uses: Swatinem/[email protected]
- uses: Swatinem/[email protected]
with:
# Reuse the cache from the normal `build` job instead of creating an independent one,
# to reduce redundant work and save disk space — but don't *write* to that cache.
prefix-key: "v1-rust-build-ubuntu-stable-locked"
shared-key: "build"
save-if: false

# break this out as a separate non-silenced build step
- name: Compile xtask
Expand Down Expand Up @@ -288,8 +300,11 @@ jobs:
steps:
- uses: actions/[email protected]

- uses: Swatinem/[email protected]

- uses: Swatinem/[email protected]
with:
# This is not necessary for keying, but makes the GHA cache viewing page more helpful.
prefix-key: "v1-rust-miri"

- name: Install Rust toolchain
run: |
rustup toolchain install nightly --component miri
Expand All @@ -311,7 +326,7 @@ jobs:
- uses: actions/[email protected]

# The build is faster *without* this cache.
# - uses: Swatinem/rust-cache@v2.0.2
# - uses: Swatinem/rust-cache@v2.7.0

- name: Install Rust toolchain
run: |
Expand All @@ -335,8 +350,10 @@ jobs:
- uses: actions/[email protected]

# Cache both the main workspace (for xtask builds) and the fuzzing workspace
- uses: Swatinem/rust-cache@v2.0.2
- uses: Swatinem/rust-cache@v2.7.0
with:
# This is not necessary for keying, but makes the GHA cache viewing page more helpful.
prefix-key: "v1-rust-fuzz"
workspaces: |
.
fuzz
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/unstable-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ jobs:
# libasound2-dev: needed for audio via `kira`

# Load cache before doing any Rust builds
- uses: Swatinem/[email protected]
- uses: Swatinem/[email protected]
with:
# This is not necessary for keying, but makes the GHA cache viewing page more helpful.
prefix-key: "v1-rust-unstablefeatures-${{ matrix.os }}-${{ matrix.depversions }}"

# break this out as a separate non-silenced build step
- name: Compile xtask
Expand Down Expand Up @@ -137,8 +140,11 @@ jobs:
steps:
- uses: actions/[email protected]

- uses: Swatinem/[email protected]

- uses: Swatinem/[email protected]
with:
# This is not necessary for keying, but makes the GHA cache viewing page more helpful.
prefix-key: "v1-rust-unstablefeatures-miri"

- name: Install Rust toolchain
run: |
rustup toolchain install nightly --component miri
Expand Down

0 comments on commit f05d054

Please sign in to comment.