Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Test build the CodeGate image for arm64 too #1048

Merged
merged 3 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
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
16 changes: 14 additions & 2 deletions .github/workflows/image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
description: 'The name of the artifact to upload'
required: true
type: string
platform:
description: 'The platform to build the image for'
required: true
type: string

permissions:
contents: read
Expand All @@ -22,6 +26,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Set up QEMU for cross-platform builds
# Only set up QEMU if the platform is not linux/amd64
if: ${{ inputs.platform != 'linux/amd64' }}
uses: docker/setup-qemu-action@4574d27a4764455b42196d70a065bc6853246a25 # v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca # v3
- name: Download artifact
Expand All @@ -43,13 +51,13 @@ jobs:
run: |
git lfs install
git lfs pull
- name: Test build on x86
- name: Test build - ${{ inputs.platform }}
id: docker_build
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
platforms: ${{ inputs.platform }}
push: false # Only attempt to build, to verify the Dockerfile is working
load: true
cache-from: type=gha
Expand All @@ -58,12 +66,16 @@ jobs:
LATEST_RELEASE=${{ env.LATEST_RELEASE }}
tags: ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
- name: Save Docker image as a tarball
# Only save the image if the build was for linux/amd64, as we only need it for the integration tests
if: ${{ inputs.platform == 'linux/amd64' }}
run: |
# List all images
docker images
# Save the image as a tarball
docker save -o image.tar ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
- name: Upload Docker image artifact
# Only upload the image if the build was for linux/amd64, as we only need it for the integration tests
if: ${{ inputs.platform == 'linux/amd64' }}
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4
with:
name: ${{ inputs.artifact-name }}
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/run-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,17 @@ jobs:
name: Build, Test & Lint
uses: ./.github/workflows/ci.yml
image-build:
name: OCI Image - Build
name: OCI Image - Build x86
uses: ./.github/workflows/image-build.yml
with:
artifact-name: "codegate-image"
platform: "linux/amd64"
image-build-arm64:
name: OCI Image - Build ARM64
uses: ./.github/workflows/image-build.yml
with:
artifact-name: "codegate-image"
platform: "linux/arm64"
integration-tests:
if: github.event.pull_request.head.repo.full_name == 'stacklok/codegate'
name: Integration Tests
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/run-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,17 @@ jobs:
name: Build, Test & Lint
uses: ./.github/workflows/ci.yml
image-build:
name: OCI Image - Build
name: OCI Image - Build x86
uses: ./.github/workflows/image-build.yml
with:
artifact-name: "codegate-image"
platform: "linux/amd64"
image-build-arm64:
name: OCI Image - Build ARM64
uses: ./.github/workflows/image-build.yml
with:
artifact-name: "codegate-image"
platform: "linux/arm64"
integration-tests:
name: Integration Tests
needs: [ci, image-build] # We need the image available in order to run the integration tests
Expand Down
Loading