|
| 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