Skip to content

Commit

Permalink
ci: Add caching
Browse files Browse the repository at this point in the history
We have a handful of jobs that could benefit from reusing the target
directory. Make use of Swatinem/rust-cache to do so.

Something still isn't quite right since the largest job only seems to
be restoring a portion of the cache, but this still shows an improvement
for most jobs.
  • Loading branch information
tgross35 committed Dec 7, 2024
1 parent 5f6c5b0 commit bc64efe
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
run: ./ci/install-rust.sh
- name: Check style
run: ./ci/style.sh

Expand All @@ -43,8 +42,20 @@ jobs:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
run: ./ci/install-rust.sh

# FIXME(ci): These `du` statements are temporary for debugging cache
- name: Target size before restoring cache
run: du -sh target | sort -k 2 || true
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}-${{ matrix.toolchain }}
- name: Target size after restoring cache
run: du -sh target | sort -k 2 || true

- name: Execute build.sh
run: ./ci/verify-build.sh
- name: Target size after job completion
run: du -sh target | sort -k 2

test_tier1:
name: Test tier1
Expand Down Expand Up @@ -81,6 +92,9 @@ jobs:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
run: ./ci/install-rust.sh
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Run natively
if: "!matrix.docker"
run: ./ci/run.sh ${{ matrix.target }}
Expand Down Expand Up @@ -132,6 +146,9 @@ jobs:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
run: ./ci/install-rust.sh
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Execute run-docker.sh
run: ./ci/run-docker.sh ${{ matrix.target }}

Expand Down

0 comments on commit bc64efe

Please sign in to comment.