7575 - name : Run unit tests
7676 run : cargo test --locked --all-targets --workspace --all-features
7777 timeout-minutes : 10
78+
7879 check :
7980 runs-on : ubuntu-latest
8081 outputs :
8485 - uses : ./.github/actions/setup-rust
8586 - run : cargo xtask ci-job check
8687 id : check
88+
8789 generate-matrix :
8890 runs-on : ubuntu-latest
8991 outputs :
@@ -116,7 +118,6 @@ jobs:
116118 coverage-artifact : ${{ steps.cov.outputs.artifact-name }}
117119 steps :
118120 - uses : actions/checkout@v3
119-
120121 - uses : ./.github/actions/setup-rust
121122
122123 - name : Set up Docker Buildx
@@ -152,6 +153,7 @@ jobs:
152153 name=${{ steps.prepare-meta.outputs.image }}
153154 labels : |
154155 ${{ fromJSON(steps.prepare-meta.outputs.labels) }}
156+
155157 - name : Build Docker image
156158 id : build-docker-image
157159 timeout-minutes : 60
@@ -182,6 +184,7 @@ jobs:
182184 registry : ghcr.io
183185 username : ${{ github.actor }}
184186 password : ${{ secrets.GITHUB_TOKEN }}
187+
185188 - name : Push image to GitHub Container Registry
186189 if : >
187190 (
@@ -211,7 +214,6 @@ jobs:
211214 coverage-artifact : ${{ steps.cov.outputs.artifact-name }}
212215 steps :
213216 - uses : actions/checkout@v3
214-
215217 - uses : ./.github/actions/setup-rust
216218
217219 - name : Set up Docker Buildx
@@ -250,6 +252,32 @@ jobs:
250252 name=${{ steps.prepare-meta.outputs.image }}
251253 labels : |
252254 ${{ fromJSON(steps.prepare-meta.outputs.labels) }}
255+
256+ - name : Set env Base Image
257+ if : steps.prepare-meta.outputs.has-image
258+ run : |
259+ if [[ "${SUB}" == "centos" ]]; then
260+ echo "BASE=centos" >> "${GITHUB_ENV}"
261+ elif [[ "${TARGET}" == *emscripten ]]; then
262+ echo "BASE=emscripten" >> "${GITHUB_ENV}"
263+ else
264+ echo "BASE=ubuntu" >> "${GITHUB_ENV}"
265+ fi
266+ env :
267+ TARGET : ${{ matrix.target }}
268+ SUB : ${{ matrix.sub }}
269+
270+ - uses : actions/download-artifact@v3
271+ if : steps.prepare-meta.outputs.has-image
272+ with :
273+ name : base-${{ env.BASE }}-image-tarball
274+ path : base.tar
275+
276+ - name : Load Base Image
277+ id : load-docker-image
278+ if : steps.prepare-meta.outputs.has-image
279+ run : docker load "base.tar"
280+
253281 - name : Build Docker image
254282 id : build-docker-image
255283 if : steps.prepare-meta.outputs.has-image
@@ -261,6 +289,7 @@ jobs:
261289 LABELS : ${{ steps.docker-meta.outputs.labels }}
262290 LATEST : ${{ needs.check.outputs.is-latest || 'false' }}
263291 shell : bash
292+
264293 - name : Set Docker image for test
265294 if : steps.prepare-meta.outputs.has-image
266295 run : |
@@ -270,6 +299,7 @@ jobs:
270299 TARGET : ${{ matrix.target }}
271300 IMAGE : ${{ steps.build-docker-image.outputs.image }}
272301 shell : bash
302+
273303 - name : Test Image
274304 if : steps.prepare-meta.outputs.has-image && steps.prepare-meta.outputs.test-variant == 'default'
275305 run : ./ci/test.sh
@@ -282,6 +312,7 @@ jobs:
282312 RUN : ${{ matrix.run }}
283313 RUNNERS : ${{ matrix.runners }}
284314 shell : bash
315+
285316 - uses : ./.github/actions/cargo-install-upload-artifacts
286317 if : matrix.deploy
287318 with :
@@ -307,6 +338,7 @@ jobs:
307338 registry : ghcr.io
308339 username : ${{ github.actor }}
309340 password : ${{ secrets.GITHUB_TOKEN }}
341+
310342 - name : Push image to GitHub Container Registry
311343 if : >
312344 steps.prepare-meta.outputs.has-image && (
@@ -372,15 +404,18 @@ jobs:
372404 uses : ./.github/actions/cargo-llvm-cov
373405 with :
374406 name : integration-bisect
407+
375408 - name : Set up QEMU
376409 uses : docker/setup-qemu-action@v2
377410 with :
378411 platforms : arm64
412+
379413 - name : Set up docker buildx
380414 uses : docker/setup-buildx-action@v2
381415 id : buildx
382416 with :
383417 install : true
418+
384419 - name : Run Foreign toolchain test
385420 run : ./ci/test-foreign-toolchain.sh
386421 shell : bash
@@ -418,7 +453,6 @@ jobs:
418453 coverage-artifact : ${{ steps.cov.outputs.artifact-name }}
419454 steps :
420455 - uses : actions/checkout@v3
421-
422456 - uses : ./.github/actions/setup-rust
423457
424458 - name : Install Podman
0 commit comments