@@ -108,6 +108,14 @@ jobs:
108
108
- uses : Swatinem/rust-cache@v2
109
109
with :
110
110
key : ${{ matrix.target }}
111
+ - name : Cache Docker layers
112
+ uses : actions/cache@v2
113
+ if : matrix.os == 'ubuntu-latest'
114
+ with :
115
+ path : /tmp/.buildx-cache
116
+ key : ${{ matrix.target }}-buildx-${{ github.sha }}
117
+ restore-keys : ${{ matrix.target }}-buildx-
118
+
111
119
- name : Download compiler-rt reference sources
112
120
run : |
113
121
curl -L -o code.tar.gz https://github.com/rust-lang/llvm-project/archive/rustc/18.0-2024-02-13.tar.gz
@@ -123,10 +131,23 @@ jobs:
123
131
NO_STD : ${{ matrix.no_std }}
124
132
TEST_VERBATIM : ${{ matrix.test_verbatim }}
125
133
134
+ # Configure buildx to use Docker layer caching
135
+ - uses : docker/setup-buildx-action@v3
136
+ if : matrix.os == 'ubuntu-latest'
137
+
126
138
# Otherwise we use our docker containers to run builds
127
139
- run : cargo generate-lockfile && ./ci/run-docker.sh ${{ matrix.target }}
128
140
if : matrix.os == 'ubuntu-latest'
129
141
142
+ # Workaround to keep Docker cache smaller
143
+ # https://github.com/docker/build-push-action/issues/252
144
+ # https://github.com/moby/buildkit/issues/1896
145
+ - name : Move Docker cache
146
+ if : matrix.os == 'ubuntu-latest'
147
+ run : |
148
+ rm -rf /tmp/.buildx-cache
149
+ mv /tmp/.buildx-cache-new /tmp/.buildx-cache
150
+
130
151
rustfmt :
131
152
name : Rustfmt
132
153
runs-on : ubuntu-latest
0 commit comments