Skip to content

Package the native server as an opt-in release-candidate image #4

Package the native server as an opt-in release-candidate image

Package the native server as an opt-in release-candidate image #4

Workflow file for this run

name: Native image
# Builds the native (Rust) server image from Dockerfile.native and runs the
# same smoke test the native release runs (Server #325). Only changes to the
# image's own files run it: the release workflow is dispatch-only, so this is
# where a pull request finds out that the Dockerfile, its ignore file or the
# smoke and publish scripts no longer work. Nothing is pushed.
on:
pull_request:
paths:
- Dockerfile.native
- Dockerfile.native.dockerignore
- scripts/ci/native-image-smoke.sh
- scripts/ci/native-release-publish.sh
- .github/workflows/native-image.yml
- .github/workflows/native-release.yml
permissions:
contents: read
concurrency:
group: native-image-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
smoke:
name: Build and smoke the native image (${{ matrix.platform }})
runs-on: ${{ matrix.runner }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- platform: linux/amd64
arch: amd64
runner: ubuntu-latest
- platform: linux/arm64
arch: arm64
runner: ubuntu-24.04-arm
env:
RESOURCE_SCOPE: dw-native-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}
steps:
- name: Check out
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4
- name: Build the image into the local daemon
timeout-minutes: 45
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7
with:
context: .
file: Dockerfile.native
platforms: ${{ matrix.platform }}
pull: true
provenance: false
load: true
push: false
tags: ${{ env.RESOURCE_SCOPE }}:smoke
- name: Smoke-test the image
env:
PLATFORM: ${{ matrix.platform }}
ARCH: ${{ matrix.arch }}
run: bash scripts/ci/native-image-smoke.sh "$RESOURCE_SCOPE:smoke" "$PLATFORM" "native-image/smoke-$ARCH.json"
- name: Remove this job's smoke containers and network
if: always()
run: |
docker rm -f "$RESOURCE_SCOPE-native-sqlite" "$RESOURCE_SCOPE-native-pgsql" "$RESOURCE_SCOPE-native-mysql" "$RESOURCE_SCOPE-postgres" "$RESOURCE_SCOPE-mysql" || true
docker network rm "$RESOURCE_SCOPE" || true
- name: Keep the smoke receipt
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: native-image-smoke-${{ matrix.arch }}
path: native-image
retention-days: 7
if-no-files-found: ignore