Skip to content

Commit cd4c232

Browse files
authored
Merge pull request #1383 from Phala-Network/ci-cache
Use sccache in CI
2 parents d4c5445 + 5c9305e commit cd4c232

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: "Setup cache"
2+
description: "Setup cache"
3+
4+
inputs:
5+
key:
6+
description: "subkey of the cache"
7+
required: true
8+
9+
runs:
10+
using: "composite"
11+
steps:
12+
- name: Cache Rust toolchain
13+
uses: actions/cache@v3
14+
with:
15+
key: rust-toolchain
16+
path: |
17+
~/.cargo
18+
~/.rustup

.github/workflows/build.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,36 @@ jobs:
1414
name: Build core
1515
runs-on: ubuntu-20.04
1616
steps:
17+
- name: Run sccache-cache
18+
uses: mozilla-actions/[email protected]
1719
- uses: actions/checkout@v3
1820
with:
1921
submodules: 'true'
22+
- uses: ./.github/actions/setup-cache
23+
with:
24+
key: core
2025
- uses: ./.github/actions/maximize-disk-space
2126
- uses: ./.github/actions/build-core
27+
env:
28+
SCCACHE_GHA_ENABLED: "true"
29+
RUSTC_WRAPPER: "sccache"
2230
build-pruntime:
2331
name: Build pruntime
2432
runs-on: ubuntu-20.04
2533
steps:
34+
- name: Run sccache-cache
35+
uses: mozilla-actions/[email protected]
2636
- uses: actions/checkout@v3
2737
with:
2838
submodules: 'true'
39+
- uses: ./.github/actions/setup-cache
40+
with:
41+
key: pruntime
2942
- uses: ./.github/actions/maximize-disk-space
3043
- uses: ./.github/actions/build-pruntime
44+
env:
45+
SCCACHE_GHA_ENABLED: "true"
46+
RUSTC_WRAPPER: "sccache"
3147
build-prouter:
3248
name: Build prouter
3349
runs-on: ubuntu-20.04

0 commit comments

Comments
 (0)