50
50
tags : " ${{ env.IMAGE_NAME }}:${{ github.run_id }}"
51
51
cache-from : type=gha,scope=${{ matrix.channel }}
52
52
cache-to : type=gha,scope=${{ matrix.channel }},mode=max
53
- build_tool_containers :
54
- name : Build ${{ matrix.tool }} tool container
55
- runs-on : ubuntu-latest
56
- needs : build_compiler_containers
57
- strategy :
58
- matrix :
59
- tool :
60
- - clippy
61
- - miri
62
- - rustfmt
63
- if : ' github.event_name == '' push'' || contains(github.event.pull_request.labels.*.name, '' CI: approved'' )'
64
- env :
65
- IMAGE_NAME : ghcr.io/integer32llc/rust-playground-ci-tool-${{ matrix.tool }}
66
- steps :
67
- - name : Checkout code
68
- uses : actions/checkout@v3
69
- with :
70
- ref : " ${{ github.event.pull_request.head.sha }}"
71
- - name : Set up Docker Buildx
72
- uses : docker/setup-buildx-action@v2
73
- with :
74
- driver-opts : image=moby/buildkit:v0.11.6
75
- - name : Login to GitHub Container Registry
76
- uses : docker/login-action@v2
77
- with :
78
- registry : ghcr.io
79
- username : " ${{ env.GH_CONTAINER_REGISTRY_USERNAME }}"
80
- password : " ${{ secrets.GH_CONTAINER_REGISTRY_TOKEN }}"
81
- - name : Build and push container
82
- uses : docker/build-push-action@v4
83
- with :
84
- context : compiler/${{ matrix.tool }}/
85
- file : compiler/${{ matrix.tool }}/Dockerfile
86
- build-args : base_image=ghcr.io/integer32llc/rust-playground-ci-rust-nightly:${{ github.run_id }}
87
- push : true
88
- tags : " ${{ env.IMAGE_NAME }}:${{ github.run_id }}"
89
- cache-from : type=gha,scope=${{ matrix.tool }}
90
- cache-to : type=gha,scope=${{ matrix.tool }},mode=max
91
53
build_backend :
92
54
name : Build backend
93
55
runs-on : ubuntu-latest
@@ -171,7 +133,6 @@ jobs:
171
133
if : ' github.event_name == '' push'' || contains(github.event.pull_request.labels.*.name, '' CI: approved'' )'
172
134
needs :
173
135
- build_compiler_containers
174
- - build_tool_containers
175
136
- build_backend
176
137
- build_frontend
177
138
defaults :
@@ -198,19 +159,14 @@ jobs:
198
159
bundle config path vendor/bundle
199
160
bundle install --jobs 4 --retry 3
200
161
- name : Pull containers
201
- run : echo ghcr.io/integer32llc/rust-playground-ci-{ rust-{stable,beta,nightly},tool-{clippy,rustfmt,miri} }:${{ github.run_id }} | xargs -n1 docker pull
162
+ run : echo ghcr.io/integer32llc/rust-playground-ci-rust-{stable,beta,nightly}:${{ github.run_id }} | xargs -n1 docker pull
202
163
- name : Rename containers
203
164
run : |-
204
165
for c in stable beta nightly; do
205
166
docker tag ghcr.io/integer32llc/rust-playground-ci-rust-$c:${{ github.run_id }} ghcr.io/integer32llc/rust-playground-ci-rust-$c
206
167
docker tag ghcr.io/integer32llc/rust-playground-ci-rust-$c:${{ github.run_id }} shepmaster/rust-$c
207
168
docker tag ghcr.io/integer32llc/rust-playground-ci-rust-$c:${{ github.run_id }} rust-$c
208
169
done
209
- for t in clippy miri rustfmt; do
210
- docker tag ghcr.io/integer32llc/rust-playground-ci-tool-$t:${{ github.run_id }} ghcr.io/integer32llc/rust-playground-ci-tool-$t
211
- docker tag ghcr.io/integer32llc/rust-playground-ci-tool-$t:${{ github.run_id }} shepmaster/$t
212
- docker tag ghcr.io/integer32llc/rust-playground-ci-tool-$t:${{ github.run_id }} $t
213
- done
214
170
- name : Download backend
215
171
uses : actions/download-artifact@v3
216
172
with :
@@ -265,29 +221,20 @@ jobs:
265
221
username : " ${{ env.DOCKER_HUB_USERNAME }}"
266
222
password : " ${{ secrets.DOCKER_HUB_TOKEN }}"
267
223
- name : Pull containers
268
- run : echo ghcr.io/integer32llc/rust-playground-ci-{ rust-{stable,beta,nightly},tool-{clippy,rustfmt,miri} }:${{ github.run_id }} | xargs -n1 docker pull
224
+ run : echo ghcr.io/integer32llc/rust-playground-ci-rust-{stable,beta,nightly}:${{ github.run_id }} | xargs -n1 docker pull
269
225
- name : Rename containers
270
226
run : |-
271
227
for c in stable beta nightly; do
272
228
docker tag ghcr.io/integer32llc/rust-playground-ci-rust-$c:${{ github.run_id }} ghcr.io/integer32llc/rust-playground-ci-rust-$c
273
229
docker tag ghcr.io/integer32llc/rust-playground-ci-rust-$c:${{ github.run_id }} shepmaster/rust-$c
274
230
docker tag ghcr.io/integer32llc/rust-playground-ci-rust-$c:${{ github.run_id }} rust-$c
275
231
done
276
- for t in clippy miri rustfmt; do
277
- docker tag ghcr.io/integer32llc/rust-playground-ci-tool-$t:${{ github.run_id }} ghcr.io/integer32llc/rust-playground-ci-tool-$t
278
- docker tag ghcr.io/integer32llc/rust-playground-ci-tool-$t:${{ github.run_id }} shepmaster/$t
279
- docker tag ghcr.io/integer32llc/rust-playground-ci-tool-$t:${{ github.run_id }} $t
280
- done
281
232
- name : Push containers
282
233
run : |-
283
234
for c in stable beta nightly; do
284
235
docker push ghcr.io/integer32llc/rust-playground-ci-rust-$c
285
236
docker push shepmaster/rust-$c
286
237
done
287
- for t in clippy miri rustfmt; do
288
- docker push ghcr.io/integer32llc/rust-playground-ci-tool-$t
289
- docker push shepmaster/$t
290
- done
291
238
- name : Download backend
292
239
uses : actions/download-artifact@v3
293
240
with :
0 commit comments