Skip to content

Commit 3729708

Browse files
authored
Merge pull request #277 from obviyus/rust
CI: add ccache
2 parents 8687614 + 090f9e2 commit 3729708

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,17 @@ jobs:
6262
# Setup: checkout
6363
- uses: actions/checkout@v2
6464

65+
# Setup: Store matrix name
66+
- run: echo 'MATRIX_NAME=${{ matrix.arch }}-${{ matrix.toolchain }}-${{ matrix.config }}' >> $GITHUB_ENV
67+
68+
# Setup: Github cache
69+
- uses: actions/cache@v2
70+
with:
71+
path: ~/.ccache
72+
key: ${{ env.MATRIX_NAME  }}-ccache-${{ github.run_id }}
73+
restore-keys: |
74+
${{ env.MATRIX_NAME  }}-ccache-
75+
6576
# Setup: variables
6677
- if: matrix.arch == 'x86_64'
6778
run: |
@@ -194,6 +205,15 @@ jobs:
194205
- run: |
195206
curl -o bin/bindgen https://raw.githubusercontent.com/Rust-for-Linux/ci-bin/master/bindgen-0.56.0/bin/bindgen
196207
chmod u+x bin/bindgen
208+
209+
# Setup: ccache
210+
- run: |
211+
sudo apt-get install ccache
212+
echo '/usr/lib/ccache:$PATH' >> $GITHUB_PATH
213+
echo 'CCACHE_COMPRESS=true' >> $GITHUB_ENV
214+
215+
# Setup: Check existing ccache
216+
- run: ccache -s
197217

198218
# Setup: busybox
199219
- run: git clone --depth 1 -b 1_30_1 https://github.com/mirror/busybox
@@ -376,3 +396,6 @@ jobs:
376396

377397
# Formatting
378398
- run: make rustfmtcheck
399+
400+
# View changes to ccache
401+
- run: ccache -s

0 commit comments

Comments
 (0)