Skip to content

Commit

Permalink
ci: add Podman validation to the build-images step
Browse files Browse the repository at this point in the history
Introduce a matrix in the Kubernetes integration tests job to support
both Docker and Podman for image builds. Add `oci_bin` as a matrix entry
to control which container runtime is used. Conditionally install Podman
when required and build images using the appropriate runtime.

Ensure that integration tests only run with Docker by skipping them when
Podman is used, avoiding unnecessary test runs. This change ensures
Podman compatibility for image builds while keeping the test process the
same for Docker.

Signed-off-by: Andrew McDermott <[email protected]>
  • Loading branch information
frobware committed Sep 6, 2024
1 parent c686cd1 commit 1333584
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,12 @@ jobs:
git diff --exit-code -I'^ createdAt: ' bundle
kubernetes-integration-tests:
name: Kubernetes Integration Tests (Go ${{ matrix.go }} - amd64)
name: Kubernetes Integration Tests (Go ${{ matrix.go }} - amd64 - ${{ matrix.oci_bin }})
runs-on: ubuntu-latest
strategy:
matrix:
go: ['1.22']
oci_bin: ['docker', 'podman']
env:
BPFMAN_AGENT_IMG: quay.io/bpfman/bpfman-agent:int-test
BPFMAN_OPERATOR_IMG: quay.io/bpfman/bpfman-operator:int-test
Expand Down Expand Up @@ -120,11 +121,19 @@ jobs:
with:
fetch-depth: 0

- name: Build Operator and Agent images
- name: Install OCI runtime (Docker or Podman)
run: |
make build-images
if [ "${{ matrix.oci_bin }}" = "podman" ]; then
sudo apt-get update && sudo apt-get install -y podman
fi
- name: Build Operator and Agent images with ${{ matrix.oci_bin }}
run: |
make OCI_BIN=${{ matrix.oci_bin }} build-images
# Run integration tests only if OCI_BIN is Docker.
- name: Run integration tests
if: ${{ matrix.oci_bin == 'docker' }}
run: |
make test-integration
Expand Down

0 comments on commit 1333584

Please sign in to comment.