Skip to content

Commit 13f9ce3

Browse files
tgross35Amanieu
authored andcommitted
Add caching for downloading compiler-rt
1 parent 9f3c865 commit 13f9ce3

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

.github/workflows/main.yml

+12-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on: [push, pull_request]
44
env:
55
RUSTDOCFLAGS: -Dwarnings
66
RUSTFLAGS: -Dwarnings
7+
RUST_LLVM_VERSION: 18.0-2024-02-13
8+
RUST_COMPILER_RT_ROOT: ./compiler-rt
79

810
jobs:
911
test:
@@ -115,12 +117,18 @@ jobs:
115117
path: /tmp/.buildx-cache
116118
key: ${{ matrix.target }}-buildx-${{ github.sha }}
117119
restore-keys: ${{ matrix.target }}-buildx-
118-
120+
121+
- name: Cache compiler-rt
122+
id: cache-compiler-rt
123+
uses: actions/cache@v4
124+
with:
125+
path: compiler-rt
126+
key: ${{ runner.os }}-compiler-rt-${{ env.RUST_LLVM_VERSION }}
119127
- name: Download compiler-rt reference sources
128+
if: steps.cache-compiler-rt.outputs.cache-hit != 'true'
120129
run: |
121-
curl -L -o code.tar.gz https://github.com/rust-lang/llvm-project/archive/rustc/18.0-2024-02-13.tar.gz
122-
tar xzf code.tar.gz --strip-components 1 llvm-project-rustc-18.0-2024-02-13/compiler-rt
123-
echo RUST_COMPILER_RT_ROOT=./compiler-rt >> $GITHUB_ENV
130+
curl -L -o code.tar.gz "https://github.com/rust-lang/llvm-project/archive/rustc/${RUST_LLVM_VERSION}.tar.gz"
131+
tar xzf code.tar.gz --strip-components 1 llvm-project-rustc-${RUST_LLVM_VERSION}/compiler-rt
124132
shell: bash
125133

126134
# Non-linux tests just use our raw script

0 commit comments

Comments
 (0)