20230828 bm v4 #473
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Kind | |
on: | |
pull_request: | |
branches: | |
- main | |
- release-* | |
- feature/* | |
push: | |
branches: | |
- main | |
- release-* | |
- feature/* | |
jobs: | |
build-antrea-coverage-image: | |
name: Build Antrea image to be used for Kind e2e tests | |
runs-on: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
show-progress: false | |
- name: Build Antrea Docker image with code coverage support | |
run: | | |
./hack/build-antrea-linux-all.sh --pull --coverage | |
- name: Save Antrea image to tarball | |
run: docker save -o antrea-ubuntu.tar antrea/antrea-ubuntu-coverage:latest | |
- name: Upload Antrea image for subsequent jobs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: antrea-ubuntu-cov | |
path: antrea-ubuntu.tar | |
retention-days: 1 # minimum value, in case artifact deletion by 'artifact-cleanup' job fails | |
test-e2e-encap-all-features-enabled: | |
name: E2e tests on a Kind cluster on Linux with all features enabled | |
needs: [build-antrea-coverage-image] | |
runs-on: [ubuntu-latest] | |
steps: | |
- name: Free disk space | |
# https://github.com/actions/virtual-environments/issues/709 | |
run: | | |
sudo apt-get clean | |
df -h | |
- uses: actions/checkout@v4 | |
with: | |
show-progress: false | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
- name: Download Antrea image from previous job | |
uses: actions/download-artifact@v4 | |
with: | |
name: antrea-ubuntu-cov | |
- name: Load Antrea image | |
run: | | |
docker load -i antrea-ubuntu.tar | |
- name: Install Kind | |
run: | | |
KIND_VERSION=$(head -n1 ./ci/kind/version) | |
curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-$(uname)-amd64 | |
chmod +x ./kind | |
sudo mv kind /usr/local/bin | |
- name: Run e2e tests | |
run: | | |
mkdir log | |
mkdir test-e2e-encap-all-features-enabled-coverage | |
ANTREA_LOG_DIR=$PWD/log ANTREA_COV_DIR=$PWD/test-e2e-encap-all-features-enabled-coverage ./ci/kind/test-e2e-kind.sh \ | |
--encap-mode encap \ | |
--coverage \ | |
--feature-gates AllAlpha=true,AllBeta=true \ | |
--proxy-all \ | |
--node-ipam \ | |
--multicast | |
- name: Tar coverage files | |
run: tar -czf test-e2e-encap-all-features-enabled-coverage.tar.gz test-e2e-encap-all-features-enabled-coverage log | |
- name: Upload coverage for test-e2e-encap-all-features-enabled-coverage | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-e2e-encap-all-features-enabled-coverage | |
path: test-e2e-encap-all-features-enabled-coverage.tar.gz | |
retention-days: 30 | |
# Runs after all other jobs in the workflow succeed and deletes Antrea Docker images uploaded as temporary | |
# artifacts. It uses a third-party, MIT-licensed action (geekyeggo/delete-artifact). While Github | |
# exposes an API for deleting artifacts, they do not support an official delete-artifact action | |
# yet. | |
artifact-cleanup: | |
name: Delete uploaded images | |
needs: | |
- build-antrea-coverage-image | |
- test-e2e-encap-all-features-enabled | |
runs-on: [ubuntu-latest] | |
steps: | |
- name: Delete antrea-ubuntu-cov | |
if: ${{ needs.build-antrea-coverage-image.result == 'success' }} | |
uses: geekyeggo/delete-artifact@v2 | |
with: | |
name: antrea-ubuntu-cov |