|
23 | 23 | - name: Lint
|
24 | 24 | run: yarn lint
|
25 | 25 |
|
| 26 | + job_docker: |
| 27 | + name: Build Docker Image |
| 28 | + runs-on: ubuntu-latest |
| 29 | + steps: |
| 30 | + - name: Check out current commit |
| 31 | + uses: actions/checkout@v4 |
| 32 | + - name: Build Docker Image |
| 33 | + uses: docker/build-push-action@v5 |
| 34 | + with: |
| 35 | + context: . |
| 36 | + push: false # Don't push to a registry, just build locally |
| 37 | + tags: ubuntu-local:latest |
| 38 | + - name: Save Docker Image as Artifact |
| 39 | + run: | |
| 40 | + docker save ubuntu-local:latest | gzip > ubuntu-local-image.tar.gz |
| 41 | + - name: Upload Docker Image Artifact |
| 42 | + uses: actions/upload-artifact@v4 |
| 43 | + with: |
| 44 | + name: ubuntu-local-docker-image |
| 45 | + path: ubuntu-local-image.tar.gz |
| 46 | + retention-days: 1 |
| 47 | + |
26 | 48 | job_compile:
|
27 | 49 | name: Compile Binary (v${{ matrix.node }}) ${{ matrix.target_platform || matrix.os }}, ${{ matrix.arch || matrix.container }}, ${{ contains(matrix.container, 'alpine') && 'musl' || 'glibc' }}
|
| 50 | + needs: [job_docker] |
28 | 51 | runs-on: ${{ matrix.os }}
|
29 | 52 | container:
|
30 | 53 | image: ${{ matrix.container }}
|
@@ -174,13 +197,17 @@ jobs:
|
174 | 197 | apk add --no-cache build-base git g++ make curl python3
|
175 | 198 | ln -sf python3 /usr/bin/python
|
176 | 199 |
|
177 |
| - - name: Setup (Docker) |
178 |
| - if: contains(matrix.container, 'ubuntu-local') |
179 |
| - uses: docker/build-push-action@v5 |
| 200 | + - name: Download Docker Image Artifact |
| 201 | + if: matrix.container == 'ubuntu-local:latest' |
| 202 | + uses: actions/download-artifact@v4 |
180 | 203 | with:
|
181 |
| - context: . |
182 |
| - push: false # Don't push to a registry, just build locally |
183 |
| - tags: ubuntu-local:latest |
| 204 | + name: ubuntu-local-docker-image |
| 205 | + path: /tmp/ |
| 206 | + |
| 207 | + - name: Load Docker Image |
| 208 | + if: matrix.container == 'ubuntu-local:latest' |
| 209 | + run: | |
| 210 | + docker load < /tmp/ubuntu-local-image.tar.gz |
184 | 211 |
|
185 | 212 | - name: Check out current commit
|
186 | 213 | uses: actions/checkout@v4
|
|
0 commit comments