Skip to content

Commit 7e3aa12

Browse files
authored
Move KinD tests for UBI images to a dedicated workflow (#6091)
Create a dedicated workflow for KinD tests of UBI images to align with the Ubuntu images. Fixes #6031 Fixes #6095 Signed-off-by: Xu Liu <[email protected]>
1 parent b1d560a commit 7e3aa12

File tree

2 files changed

+76
-26
lines changed

2 files changed

+76
-26
lines changed

.github/workflows/build.yml

-26
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@ jobs:
8888
if: ${{ github.repository != 'antrea-io/antrea' || github.event_name != 'push' || github.ref != 'refs/heads/main' }}
8989
run: |
9090
./hack/build-antrea-linux-all.sh --pull --distro ubi
91-
- name: Clean up docker build cache
92-
# Clean up build cache to avoid running out of disk space in the following go tests.
93-
run: docker builder prune -f
9491
- name: Build and push Antrea UBI8 Docker image to registry
9592
if: ${{ github.repository == 'antrea-io/antrea' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
9693
env:
@@ -102,29 +99,6 @@ jobs:
10299
docker push antrea/antrea-ubi:latest
103100
docker push antrea/antrea-agent-ubi:latest
104101
docker push antrea/antrea-controller-ubi:latest
105-
- name: Install Kind
106-
run: |
107-
KIND_VERSION=$(head -n1 ./ci/kind/version)
108-
curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-$(uname)-amd64
109-
chmod +x ./kind
110-
sudo mv kind /usr/local/bin
111-
- name: Run basic e2e tests
112-
run: |
113-
mkdir log
114-
ANTREA_LOG_DIR=$PWD/log ./ci/kind/test-e2e-kind.sh --encap-mode encap \
115-
--antrea-controller-image antrea/antrea-controller-ubi \
116-
--antrea-agent-image antrea/antrea-agent-ubi \
117-
--run '^TestBasic$'
118-
- name: Tar log files
119-
if: ${{ failure() }}
120-
run: tar -czf log.tar.gz log
121-
- name: Upload test log
122-
uses: actions/upload-artifact@v4
123-
if: ${{ failure() }}
124-
with:
125-
name: e2e-kind-ubi-basic.tar.gz
126-
path: log.tar.gz
127-
retention-days: 30
128102
129103
build-scale:
130104
needs: check-changes

.github/workflows/kind_ubi.yml

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Kind for UBI
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
- release-*
7+
- feature/*
8+
push:
9+
branches:
10+
- main
11+
- release-*
12+
- feature/*
13+
14+
jobs:
15+
check-changes:
16+
name: Check whether tests need to be run based on diff
17+
runs-on: [ubuntu-latest]
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
show-progress: false
23+
- uses: antrea-io/has-changes@v2
24+
id: check_diff
25+
with:
26+
paths-ignore: docs/* ci/jenkins/* *.md hack/.notableofcontents plugins/*
27+
outputs:
28+
has_changes: ${{ steps.check_diff.outputs.has_changes }}
29+
30+
build-and-test-ubi:
31+
needs: check-changes
32+
if: ${{ needs.check-changes.outputs.has_changes == 'yes' || github.event_name == 'push' }}
33+
runs-on: [ubuntu-latest]
34+
steps:
35+
- name: Free disk space
36+
# https://github.com/actions/virtual-environments/issues/709
37+
run: |
38+
sudo apt-get clean
39+
df -h
40+
- uses: actions/checkout@v4
41+
with:
42+
show-progress: false
43+
- name: Set up Docker Buildx
44+
uses: docker/setup-buildx-action@v3
45+
- uses: actions/setup-go@v5
46+
with:
47+
go-version-file: 'go.mod'
48+
- name: Build Antrea UBI8 Docker image
49+
run: |
50+
./hack/build-antrea-linux-all.sh --pull --distro ubi
51+
- name: Clean up docker build cache
52+
run: |
53+
docker builder prune -f
54+
- name: Install Kind
55+
run: |
56+
KIND_VERSION=$(head -n1 ./ci/kind/version)
57+
curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-$(uname)-amd64
58+
chmod +x ./kind
59+
sudo mv kind /usr/local/bin
60+
- name: Run basic e2e tests
61+
run: |
62+
mkdir log
63+
ANTREA_LOG_DIR=$PWD/log ./ci/kind/test-e2e-kind.sh --encap-mode encap \
64+
--antrea-controller-image antrea/antrea-controller-ubi \
65+
--antrea-agent-image antrea/antrea-agent-ubi \
66+
--run '^TestBasic$'
67+
- name: Tar log files
68+
if: ${{ failure() }}
69+
run: tar -czf log.tar.gz log
70+
- name: Upload test log
71+
uses: actions/upload-artifact@v4
72+
if: ${{ failure() }}
73+
with:
74+
name: e2e-kind-ubi-basic.tar.gz
75+
path: log.tar.gz
76+
retention-days: 30

0 commit comments

Comments
 (0)