Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,19 @@ jobs:
build-cgo-linux:
name: Build (Linux CGO)
runs-on: ubuntu-latest
env:
# Force docker so the manifest check, local build, and build-runner
# all use the same container storage. GitHub runners have docker.
CONTAINER_RUNTIME: docker
steps:
- name: Checkout repository
uses: actions/checkout@v7

- name: Source versions.env
run: |
source versions.env
echo "LIBKRUN_VERSION=${LIBKRUN_VERSION}" >> "$GITHUB_ENV"

- name: Set up Task
uses: arduino/setup-task@v3.0.0
with:
Expand All @@ -108,6 +117,23 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# The builder image is tagged by LIBKRUN_VERSION. When a PR bumps
# LIBKRUN_VERSION, the image for that tag doesn't exist yet (it's
# built by builder.yaml only after merge to main). Check the registry
# and build locally if missing so CI can verify the bump.
- name: Check if builder image exists
id: check-builder
run: |
if docker manifest inspect ghcr.io/stacklok/go-microvm-builder:${LIBKRUN_VERSION} >/dev/null 2>&1; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi

- name: Build builder image locally
if: steps.check-builder.outputs.exists == 'false'
run: task builder-image-build

- name: Build runner using builder container
run: task build-runner

Expand Down
Loading