Skip to content

Commit 7ec0ee6

Browse files
committed
Add rust cache
1 parent ab60ba2 commit 7ec0ee6

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

.github/workflows/release.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ on:
4242
pull_request:
4343
push:
4444
tags:
45-
- '**[0-9]+.[0-9]+.[0-9]+*'
45+
- "**[0-9]+.[0-9]+.[0-9]+*"
4646

4747
jobs:
4848
# Run 'dist plan' (or host) to determine what tasks we need to do
@@ -129,6 +129,27 @@ jobs:
129129
- name: Install dependencies
130130
run: |
131131
${{ matrix.packages_install }}
132+
133+
- name: Configure sccache
134+
run: |
135+
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
136+
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
137+
138+
- name: Run sccache-cache
139+
uses: mozilla-actions/[email protected]
140+
141+
- name: Rust Cache
142+
uses: Swatinem/rust-cache@v2
143+
with:
144+
prefix-key: "v1-rust"
145+
shared-key: "${{ matrix.target }}-build"
146+
cache-targets: "true"
147+
cache-on-failure: "true"
148+
cache-all-crates: "true"
149+
save-if: ${{ github.ref == 'refs/heads/master' }}
150+
workspaces: |
151+
. -> target
152+
132153
- name: Build artifacts
133154
run: |
134155
# Actually do builds and make zips and whatnot
@@ -147,6 +168,7 @@ jobs:
147168
echo "EOF" >> "$GITHUB_OUTPUT"
148169
149170
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
171+
150172
- name: "Upload artifacts"
151173
uses: actions/upload-artifact@v4
152174
with:

0 commit comments

Comments
 (0)