Skip to content

Commit f30b4c2

Browse files
Speed up CI: add sccache compilation cache
1 parent bafa9d4 commit f30b4c2

4 files changed

Lines changed: 48 additions & 0 deletions

File tree

.github/workflows/anchor.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ jobs:
117117
failed_projects: ${{ steps.set-failed.outputs.failed_projects }}
118118
steps:
119119
- uses: actions/checkout@v5
120+
- name: Setup sccache
121+
uses: mozilla-actions/sccache-action@v0.0.9
122+
- name: Configure sccache
123+
run: |
124+
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
125+
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
120126
- name: Cache Cargo registry and git
121127
uses: actions/cache@v4
122128
with:
@@ -244,6 +250,9 @@ jobs:
244250
# Prepare failed projects list for output
245251
failed_projects=$(cat $GITHUB_WORKSPACE/failed_projects.txt | jq -R -s -c 'split("\n")[:-1]')
246252
echo "failed_projects=$failed_projects" >> $GITHUB_OUTPUT
253+
- name: Show sccache stats
254+
if: always()
255+
run: sccache --show-stats
247256

248257
summary:
249258
needs: [changes, build-and-test]

.github/workflows/native.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ jobs:
116116
failed_projects: ${{ steps.set-failed.outputs.failed_projects }}
117117
steps:
118118
- uses: actions/checkout@v5
119+
- name: Setup sccache
120+
uses: mozilla-actions/sccache-action@v0.0.9
121+
- name: Configure sccache
122+
run: |
123+
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
124+
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
119125
- name: Cache Cargo registry and git
120126
uses: actions/cache@v4
121127
with:
@@ -247,6 +253,9 @@ jobs:
247253
else
248254
echo "failed_projects=[]" >> $GITHUB_OUTPUT
249255
fi
256+
- name: Show sccache stats
257+
if: always()
258+
run: sccache --show-stats
250259

251260
summary:
252261
needs: [changes, build-and-test]
@@ -291,3 +300,7 @@ jobs:
291300
else
292301
echo "## :warning: Build and test job was skipped or canceled" >> $GITHUB_STEP_SUMMARY
293302
fi
303+
> $GITHUB_STEP_SUMMARY
304+
else
305+
echo "## :warning: Build and test job was skipped or canceled" >> $GITHUB_STEP_SUMMARY
306+
fi

.github/workflows/pinocchio.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ jobs:
116116
failed_projects: ${{ steps.set-failed.outputs.failed_projects }}
117117
steps:
118118
- uses: actions/checkout@v5
119+
- name: Setup sccache
120+
uses: mozilla-actions/sccache-action@v0.0.9
121+
- name: Configure sccache
122+
run: |
123+
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
124+
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
119125
- name: Cache Cargo registry and git
120126
uses: actions/cache@v4
121127
with:
@@ -247,6 +253,9 @@ jobs:
247253
else
248254
echo "failed_projects=[]" >> $GITHUB_OUTPUT
249255
fi
256+
- name: Show sccache stats
257+
if: always()
258+
run: sccache --show-stats
250259

251260
summary:
252261
needs: [changes, build-and-test]
@@ -291,3 +300,7 @@ jobs:
291300
else
292301
echo "## :warning: Build and test job was skipped or canceled" >> $GITHUB_STEP_SUMMARY
293302
fi
303+
> $GITHUB_STEP_SUMMARY
304+
else
305+
echo "## :warning: Build and test job was skipped or canceled" >> $GITHUB_STEP_SUMMARY
306+
fi

.github/workflows/quasar.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ jobs:
118118
failed_projects: ${{ steps.set-failed.outputs.failed_projects }}
119119
steps:
120120
- uses: actions/checkout@v5
121+
- name: Setup sccache
122+
uses: mozilla-actions/sccache-action@v0.0.9
123+
- name: Configure sccache
124+
run: |
125+
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
126+
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
121127
- name: Cache Cargo registry and git
122128
uses: actions/cache@v4
123129
with:
@@ -210,6 +216,9 @@ jobs:
210216
else
211217
echo "failed_projects=[]" >> $GITHUB_OUTPUT
212218
fi
219+
- name: Show sccache stats
220+
if: always()
221+
run: sccache --show-stats
213222

214223
summary:
215224
needs: [changes, build-and-test]
@@ -254,3 +263,7 @@ jobs:
254263
else
255264
echo "## :warning: Build and test job was skipped or canceled" >> $GITHUB_STEP_SUMMARY
256265
fi
266+
> $GITHUB_STEP_SUMMARY
267+
else
268+
echo "## :warning: Build and test job was skipped or canceled" >> $GITHUB_STEP_SUMMARY
269+
fi

0 commit comments

Comments
 (0)