Skip to content

Commit 7f6cd19

Browse files
authored
Merge pull request #324 from anfredette/int-test-action
Add separate workflow to run Kubernetes integration tests
2 parents f8de33d + 7921d0b commit 7f6cd19

File tree

2 files changed

+82
-73
lines changed

2 files changed

+82
-73
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Kubernetes Integration Tests
2+
3+
on:
4+
pull_request:
5+
branches: ['*']
6+
workflow_dispatch:
7+
schedule:
8+
- cron: '0 5 * * *' # Runs every day at 5 AM UTC
9+
10+
jobs:
11+
12+
kubernetes-integration-tests:
13+
name: Kubernetes Integration Tests (Go ${{ matrix.go }} - amd64 - ${{ matrix.oci_bin }})
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
go: ['1.22']
18+
oci_bin: ['docker', 'podman']
19+
env:
20+
BPFMAN_AGENT_IMG: quay.io/bpfman/bpfman-agent:int-test
21+
BPFMAN_OPERATOR_IMG: quay.io/bpfman/bpfman-operator:int-test
22+
XDP_PASS_PRIVATE_IMAGE_CREDS: ${{ secrets.XDP_PASS_PRIVATE_IMAGE_CREDS }}
23+
steps:
24+
- name: Check disk space
25+
run: df -h
26+
27+
- name: Free up space
28+
run: |
29+
sudo rm -rf /usr/share/dotnet
30+
sudo rm -rf /opt/ghc
31+
sudo rm -rf "/usr/local/share/boost"
32+
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
33+
sudo rm -rf /usr/local/lib/android
34+
35+
- name: Check disk space again
36+
run: df -h
37+
38+
- name: Install go
39+
uses: actions/setup-go@v5
40+
with:
41+
go-version: ${{ matrix.go }}
42+
43+
- name: cache go modules
44+
uses: actions/cache@v4
45+
with:
46+
path: ~/go/pkg/mod
47+
key: ${{ runner.os }}-build-codegen-${{ hashFiles('**/go.sum') }}
48+
restore-keys: |
49+
${{ runner.os }}-build-codegen-
50+
51+
- name: Checkout bpfman-operator
52+
uses: actions/checkout@v4
53+
with:
54+
fetch-depth: 0
55+
56+
- name: Install OCI runtime (Docker or Podman)
57+
run: |
58+
if [ "${{ matrix.oci_bin }}" = "podman" ]; then
59+
sudo apt-get update && sudo apt-get install -y podman
60+
fi
61+
62+
- name: Build Operator and Agent images with ${{ matrix.oci_bin }}
63+
run: |
64+
make OCI_BIN=${{ matrix.oci_bin }} build-images
65+
66+
# Run integration tests only if OCI_BIN is Docker.
67+
- name: Run integration tests
68+
if: ${{ matrix.oci_bin == 'docker' }}
69+
run: |
70+
make test-integration
71+
72+
- name: Check disk space
73+
run: df -h
74+
75+
## Upload diagnostics if integration test step failed.
76+
- name: Upload diagnostics
77+
if: ${{ failure() }}
78+
uses: actions/upload-artifact@v4
79+
with:
80+
name: kubernetes-integration-test-diag
81+
path: /tmp/ktf-diag*
82+
if-no-files-found: ignore

.github/workflows/pull_request.yml

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -77,78 +77,6 @@ jobs:
7777
make bundle
7878
git diff --exit-code -I'^ createdAt: ' bundle
7979
80-
kubernetes-integration-tests:
81-
name: Kubernetes Integration Tests (Go ${{ matrix.go }} - amd64 - ${{ matrix.oci_bin }})
82-
runs-on: ubuntu-latest
83-
strategy:
84-
matrix:
85-
go: ['1.22']
86-
oci_bin: ['docker', 'podman']
87-
env:
88-
BPFMAN_AGENT_IMG: quay.io/bpfman/bpfman-agent:int-test
89-
BPFMAN_OPERATOR_IMG: quay.io/bpfman/bpfman-operator:int-test
90-
XDP_PASS_PRIVATE_IMAGE_CREDS: ${{ secrets.XDP_PASS_PRIVATE_IMAGE_CREDS }}
91-
steps:
92-
- name: Check disk space
93-
run: df -h
94-
95-
- name: Free up space
96-
run: |
97-
sudo rm -rf /usr/share/dotnet
98-
sudo rm -rf /opt/ghc
99-
sudo rm -rf "/usr/local/share/boost"
100-
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
101-
sudo rm -rf /usr/local/lib/android
102-
103-
- name: Check disk space again
104-
run: df -h
105-
106-
- name: Install go
107-
uses: actions/setup-go@v5
108-
with:
109-
go-version: ${{ matrix.go }}
110-
111-
- name: cache go modules
112-
uses: actions/cache@v4
113-
with:
114-
path: ~/go/pkg/mod
115-
key: ${{ runner.os }}-build-codegen-${{ hashFiles('**/go.sum') }}
116-
restore-keys: |
117-
${{ runner.os }}-build-codegen-
118-
119-
- name: Checkout bpfman-operator
120-
uses: actions/checkout@v4
121-
with:
122-
fetch-depth: 0
123-
124-
- name: Install OCI runtime (Docker or Podman)
125-
run: |
126-
if [ "${{ matrix.oci_bin }}" = "podman" ]; then
127-
sudo apt-get update && sudo apt-get install -y podman
128-
fi
129-
130-
- name: Build Operator and Agent images with ${{ matrix.oci_bin }}
131-
run: |
132-
make OCI_BIN=${{ matrix.oci_bin }} build-images
133-
134-
# Run integration tests only if OCI_BIN is Docker.
135-
- name: Run integration tests
136-
if: ${{ matrix.oci_bin == 'docker' }}
137-
run: |
138-
make test-integration
139-
140-
- name: Check disk space
141-
run: df -h
142-
143-
## Upload diagnostics if integration test step failed.
144-
- name: Upload diagnostics
145-
if: ${{ failure() }}
146-
uses: actions/upload-artifact@v4
147-
with:
148-
name: kubernetes-integration-test-diag
149-
path: /tmp/ktf-diag*
150-
if-no-files-found: ignore
151-
15280
coverage:
15381
needs: [build-lint-test]
15482
runs-on: ubuntu-latest
@@ -174,7 +102,6 @@ jobs:
174102
check-license,
175103
build-lint-test,
176104
coverage,
177-
kubernetes-integration-tests,
178105
]
179106
runs-on: ubuntu-latest
180107
steps:

0 commit comments

Comments
 (0)