Skip to content

Kubernetes Integration Tests #1248

Kubernetes Integration Tests

Kubernetes Integration Tests #1248

name: Kubernetes Integration Tests
on:
workflow_call:
workflow_dispatch:
schedule:
- cron: "0 5 * * *" # Runs every day at 5 AM UTC
jobs:
kubernetes-integration-tests:
name: Go ${{ matrix.go }} - ${{ matrix.oci_bin }} - ${{ matrix.command }}
runs-on: ubuntu-24.04
strategy:
matrix:
go: ["1.25"]
oci_bin: ["docker", "podman"]
command: [
"integration",
"lifecycle"
]
exclude:
- oci_bin: podman
command: "lifecycle"
env:
BPFMAN_AGENT_IMG: quay.io/bpfman/bpfman-agent:int-test
BPFMAN_OPERATOR_IMG: quay.io/bpfman/bpfman-operator:int-test
XDP_PASS_PRIVATE_IMAGE_CREDS: ${{ secrets.XDP_PASS_PRIVATE_IMAGE_CREDS }}
steps:
- name: Check disk space
run: df -h
- name: Free up space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo rm -rf /usr/local/lib/android
- name: Check disk space again
run: df -h
- name: Checkout bpfman-operator
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install go
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go }}
cache: false
- name: Restore Go module cache
uses: actions/cache@v5
with:
path: ~/go/pkg/mod
key: go-mod-${{ hashFiles('**/go.sum') }}
restore-keys: |
go-mod-
- name: Restore Go build cache
uses: actions/cache@v5
with:
path: ~/.cache/go-build
key: go-build-${{ github.sha }}
restore-keys: |
go-build-
- name: Install OCI runtime (Docker or Podman)
run: |
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') && (matrix.command == 'integration') }}
run: |
make test-integration
# Run lifecycle tests only if OCI_BIN is Docker.
- name: Run lifecycle tests
if: ${{ (matrix.oci_bin == 'docker') && (matrix.command == 'lifecycle') }}
run: |
make run-on-kind && make test-lifecycle-local
- name: Check disk space
run: df -h
## Upload diagnostics if integration test step failed.
- name: Upload diagnostics
if: ${{ failure() }}
uses: actions/upload-artifact@v6
with:
name: kubernetes-integration-test-diag
path: /tmp/ktf-diag*
if-no-files-found: ignore