Docker build CI triggered from @joshuacolvin0 of fix-TestRetryableFilteringStylusSandwichRollback #19925
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: Docker build CI | |
| run-name: Docker build CI triggered from @${{ github.actor }} of ${{ github.head_ref }} | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| workflow_dispatch: | |
| merge_group: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| docker: | |
| name: Docker build | |
| runs-on: arbitrator-ci | |
| services: | |
| # local registry | |
| registry: | |
| image: registry:2 | |
| ports: | |
| - 5000:5000 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| with: | |
| driver-opts: network=host | |
| - name: Cache Docker layers | |
| uses: actions/cache@v5 | |
| with: | |
| path: /tmp/.buildx-cache | |
| key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile') }} | |
| restore-keys: ${{ runner.os }}-buildx- | |
| - name: Build nitro-node docker | |
| uses: docker/build-push-action@v6 | |
| with: | |
| target: nitro-node | |
| push: true | |
| context: . | |
| tags: localhost:5000/nitro-node:latest | |
| cache-from: type=local,src=/tmp/.buildx-cache | |
| cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max | |
| - name: Build nitro-node-dev docker | |
| uses: docker/build-push-action@v6 | |
| with: | |
| target: nitro-node-dev | |
| push: true | |
| context: . | |
| tags: localhost:5000/nitro-node-dev:latest | |
| cache-from: type=local,src=/tmp/.buildx-cache | |
| cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max | |
| - name: Start background nitro-testnode | |
| shell: bash | |
| run: | | |
| # Reuse the image we just built instead of rebuilding inside test-node.bash | |
| docker pull localhost:5000/nitro-node-dev:latest | |
| docker tag localhost:5000/nitro-node-dev:latest nitro-node-dev:latest | |
| docker image inspect nitro-node-dev:latest --format '{{.Id}} {{.Architecture}}' | |
| cd nitro-testnode | |
| ./test-node.bash --init --dev --no-build-dev-nitro > /tmp/testnode.log 2>&1 & | |
| echo "$!" > /tmp/testnode.pid | |
| - name: Wait for rpc to come up | |
| shell: bash | |
| run: ${{ github.workspace }}/.github/workflows/waitForNitro.sh | |
| - name: Dump testnode logs | |
| if: always() | |
| shell: bash | |
| run: | | |
| if [ -f /tmp/testnode.log ]; then | |
| echo "=== Last 200 lines of testnode.log ===" | |
| tail -200 /tmp/testnode.log | |
| fi | |
| - name: Print WAVM module root | |
| id: module-root | |
| run: | | |
| # Unfortunately, `docker cp` seems to always result in a "permission denied" | |
| # We work around this by piping a tarball through stdout | |
| docker run --rm --entrypoint tar localhost:5000/nitro-node-dev:latest -cf - target/machines/latest | tar xf - | |
| module_root="$(cat "target/machines/latest/module-root.txt")" | |
| echo "module-root=$module_root" >> "$GITHUB_OUTPUT" | |
| echo -e "\x1b[1;34mWAVM module root:\x1b[0m $module_root" | |
| - name: Upload WAVM machine as artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: wavm-machine-${{ steps.module-root.outputs.module-root }} | |
| path: target/machines/latest/* | |
| if-no-files-found: error | |
| - name: Move cache | |
| # Temp fix | |
| # https://github.com/docker/build-push-action/issues/252 | |
| # https://github.com/moby/buildkit/issues/1896 | |
| run: | | |
| rm -rf /tmp/.buildx-cache | |
| mv /tmp/.buildx-cache-new /tmp/.buildx-cache | |
| - name: Clear cache on failure | |
| if: failure() | |
| run: | | |
| keys=(${{ runner.os }}-buildx- ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile') }}) | |
| for key in "${keys[@]}"; do | |
| curl -X DELETE \ | |
| -H "Accept: application/vnd.github.v3+json" \ | |
| -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
| "${{ github.api_url }}/repos/${{ github.repository }}/actions/caches?key=$key" | |
| done |