diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 2262543aa9c..00000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,186 +0,0 @@ -name: Build and push latest image if needed - -on: - pull_request: - branches: - - main - - release-* - - feature/* - push: - branches: - - main - - release-* - - feature/* - -jobs: - check-changes: - name: Check whether tests need to be run based on diff - runs-on: [ubuntu-latest] - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: antrea-io/has-changes@v2 - id: check_diff - with: - paths-ignore: docs/* ci/jenkins/* *.md hack/.notableofcontents - outputs: - has_changes: ${{ steps.check_diff.outputs.has_changes }} - - build: - needs: check-changes - if: ${{ needs.check-changes.outputs.has_changes == 'yes' || github.event_name == 'push' }} - runs-on: [ubuntu-latest] - steps: - - uses: actions/checkout@v3 - - name: Build Antrea amd64 Docker image without pushing to registry - if: ${{ github.repository != 'antrea-io/antrea' || github.event_name != 'push' || github.ref != 'refs/heads/main' }} - run: | - ./hack/build-antrea-linux-all.sh --pull - - name: Build and push Antrea amd64 Docker image to registry - if: ${{ github.repository == 'antrea-io/antrea' && github.event_name == 'push' && github.ref == 'refs/heads/main' }} - env: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - run: | - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - ./hack/build-antrea-linux-all.sh --pull --push-base-images - docker tag antrea/antrea-ubuntu:latest antrea/antrea-ubuntu-amd64:latest - docker push antrea/antrea-ubuntu-amd64:latest - - name: Trigger Antrea arm builds and multi-arch manifest update - if: ${{ github.repository == 'antrea-io/antrea' && github.event_name == 'push' && github.ref == 'refs/heads/main' }} - uses: benc-uk/workflow-dispatch@v1 - with: - repo: vmware-tanzu/antrea-build-infra - ref: refs/heads/main - workflow: Build Antrea ARM images and push manifest - token: ${{ secrets.ANTREA_BUILD_INFRA_WORKFLOW_DISPATCH_PAT }} - inputs: ${{ format('{{ "antrea-repository":"antrea-io/antrea", "antrea-ref":"{0}", "docker-tag":"{1}" }}', github.ref, 'latest') }} - - build-ubi: - needs: check-changes - if: ${{ needs.check-changes.outputs.has_changes == 'yes' || github.event_name == 'push' }} - runs-on: [ubuntu-latest] - steps: - - uses: actions/checkout@v3 - - name: Build Antrea UBI8 Docker image without pushing to registry - if: ${{ github.repository != 'antrea-io/antrea' || github.event_name != 'push' || github.ref != 'refs/heads/main' }} - run: | - ./hack/build-antrea-linux-all.sh --pull --distro ubi - - name: Build and push Antrea UBI8 Docker image to registry - if: ${{ github.repository == 'antrea-io/antrea' && github.event_name == 'push' && github.ref == 'refs/heads/main' }} - env: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - run: | - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - ./hack/build-antrea-linux-all.sh --pull --push-base-images --distro ubi - docker push antrea/antrea-ubi:latest - - build-scale: - needs: check-changes - if: ${{ needs.check-changes.outputs.has_changes == 'yes' || github.event_name == 'push' }} - runs-on: [ubuntu-latest] - steps: - - uses: actions/checkout@v3 - - name: Build Antrea Agent Simulator Docker image - run: make build-scale-simulator - - name: Push Antrea Agent Simulator Docker image to registry - if: ${{ github.repository == 'antrea-io/antrea' && github.event_name == 'push' && github.ref == 'refs/heads/main' }} - env: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - run: | - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - docker push antrea/antrea-ubuntu-simulator:latest - - build-windows: - needs: check-changes - if: ${{ needs.check-changes.outputs.has_changes == 'yes' || github.event_name == 'push' }} - runs-on: [windows-2019] - steps: - - uses: actions/checkout@v3 - - name: Build Antrea Windows Docker image - run: make build-windows - - name: Push Antrea Windows Docker image to registry - if: ${{ github.repository == 'antrea-io/antrea' && github.event_name == 'push' && github.ref == 'refs/heads/main' }} - env: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - run: | - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - docker push antrea/antrea-windows:latest - shell: bash - - build-octant-antrea-ubuntu: - needs: check-changes - if: ${{ needs.check-changes.outputs.has_changes == 'yes' || github.event_name == 'push' }} - runs-on: [ubuntu-latest] - steps: - - uses: actions/checkout@v3 - - name: Build octant-antrea-ubuntu Docker image - run: make octant-antrea-ubuntu - - name: Push octant-antrea-ubuntu Docker image to registry - if: ${{ github.repository == 'antrea-io/antrea' && github.event_name == 'push' && github.ref == 'refs/heads/main' }} - env: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - run: | - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - docker push antrea/octant-antrea-ubuntu:latest - - build-antrea-mc-controller: - needs: check-changes - if: ${{ needs.check-changes.outputs.has_changes == 'yes' || github.event_name == 'push' }} - runs-on: [ubuntu-latest] - steps: - - uses: actions/checkout@v3 - - name: Build antrea-mc-controller Docker image - run: make antrea-mc-controller - - name: Push antrea-mc-controller Docker image to registry - if: ${{ github.repository == 'antrea-io/antrea' && github.event_name == 'push' && github.ref == 'refs/heads/main' }} - env: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - run: | - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - docker push antrea/antrea-mc-controller:latest - - build-netpol-tmp: - needs: check-changes - if: ${{ needs.check-changes.outputs.has_changes == 'yes' || github.event_name == 'push' }} - runs-on: [ubuntu-latest] - steps: - - uses: actions/checkout@v3 - - name: Build netpol Docker image - working-directory: hack/netpol - run: make build - - name: Push netpol Docker image to registry - if: ${{ github.repository == 'antrea-io/antrea' && github.event_name == 'push' && github.ref == 'refs/heads/main' }} - env: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - working-directory: hack/netpol - run: | - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - make push - make push-release - - build-flow-aggregator: - needs: check-changes - if: ${{ needs.check-changes.outputs.has_changes == 'yes' || github.event_name == 'push' }} - runs-on: [ubuntu-latest] - steps: - - uses: actions/checkout@v3 - - name: Build flow-aggregator Docker image - run: make flow-aggregator-image - - name: Check flow-aggregator Docker image - run: docker run antrea/flow-aggregator --version - - name: Push flow-aggregator Docker image to registry - if: ${{ github.repository == 'antrea-io/antrea' && github.event_name == 'push' && github.ref == 'refs/heads/main' }} - env: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - run: | - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - docker push antrea/flow-aggregator:latest diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 09c7c0e9e2c..a3b6593a019 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -15,26 +15,10 @@ env: go-cache-name: go jobs: - check-changes: - name: Check whether tests need to be run based on diff - runs-on: [ubuntu-latest] - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: antrea-io/has-changes@v2 - id: check_diff - with: - paths-ignore: docs/* ci/jenkins/* *.md hack/.notableofcontents - outputs: - has_changes: ${{ steps.check_diff.outputs.has_changes }} - # test-unit-ubuntu and test-unit-windows are intentionally not merged into one job with os matrix, otherwise the job # wouldn't be expanded if it's skipped and the report of the required check would be missing. # See https://github.com/antrea-io/antrea/issues/3563. test-unit-ubuntu: - needs: check-changes - if: ${{ needs.check-changes.outputs.has_changes == 'yes' }} name: Unit test (ubuntu-latest) runs-on: [ubuntu-latest] steps: @@ -70,8 +54,6 @@ jobs: fail_ci_if_error: ${{ github.event_name == 'push' }} test-unit-windows: - needs: check-changes - if: ${{ needs.check-changes.outputs.has_changes == 'yes' }} name: Unit test (windows-2019) runs-on: [windows-2019] steps: @@ -104,253 +86,4 @@ jobs: file: .coverage/coverage-unit.txt flags: unit-tests name: codecov-unit-test - fail_ci_if_error: ${{ github.event_name == 'push' }} - - test-integration: - needs: check-changes - if: ${{ needs.check-changes.outputs.has_changes == 'yes' }} - name: Integration test - runs-on: [ubuntu-latest] - steps: - - name: Check-out code - uses: actions/checkout@v3 - - name: Set up Go using version from go.mod - uses: actions/setup-go@v3 - with: - go-version-file: 'go.mod' - - uses: actions/cache@v3 - with: - # In order: - # * Module download cache - # * Build cache (Linux) - # * Build cache (Mac) - path: | - ~/go/pkg/mod - ~/.cache/go-build - ~/Library/Caches/go-build - %LocalAppData%\go-build - key: ${{ runner.os }}-${{ env.go-cache-name }}-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-${{ env.go-cache-name }}- - - name: Run integration tests - run: | - ./build/images/ovs/build.sh - NO_PULL=1 make docker-test-integration - - name: Run integration tests for multicluster - run: | - cd multicluster - make test-integration - - name: Codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: .coverage/coverage-integration.txt,multicluster/.coverage/coverage-integration.txt - flags: integration-tests - name: codecov-integration-test - fail_ci_if_error: ${{ github.event_name == 'push' }} - - # golangci-lint-ubuntu and golangci-lint-macos are intentionally not merged into one job with os matrix, otherwise the - # job wouldn't be expanded if it's skipped and the report of the required check would be missing. - # See https://github.com/antrea-io/antrea/issues/3563. - golangci-lint-ubuntu: - needs: check-changes - if: ${{ needs.check-changes.outputs.has_changes == 'yes' }} - name: Golangci-lint (ubuntu-latest) - runs-on: [ubuntu-latest] - steps: - - name: Check-out code - uses: actions/checkout@v3 - - name: Set up Go using version from go.mod - uses: actions/setup-go@v3 - with: - go-version-file: 'go.mod' - - uses: actions/cache@v3 - with: - # In order: - # * Module download cache - # * Build cache (Linux) - # * Build cache (Mac) - path: | - ~/go/pkg/mod - ~/.cache/go-build - ~/Library/Caches/go-build - %LocalAppData%\go-build - key: ${{ runner.os }}-${{ env.go-cache-name }}-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-${{ env.go-cache-name }}- - - name: Run golangci-lint - run: make golangci - - name: Run golangci-lint for netpol - working-directory: hack/netpol - run: make golangci - - golangci-lint-macos: - needs: check-changes - if: ${{ needs.check-changes.outputs.has_changes == 'yes' }} - name: Golangci-lint (macos-latest) - runs-on: [macos-latest] - steps: - - name: Check-out code - uses: actions/checkout@v3 - - name: Set up Go using version from go.mod - uses: actions/setup-go@v3 - with: - go-version-file: 'go.mod' - - uses: actions/cache@v3 - with: - # In order: - # * Module download cache - # * Build cache (Linux) - # * Build cache (Mac) - path: | - ~/go/pkg/mod - ~/.cache/go-build - ~/Library/Caches/go-build - %LocalAppData%\go-build - key: ${{ runner.os }}-${{ env.go-cache-name }}-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-${{ env.go-cache-name }}- - - name: Run golangci-lint - run: make golangci - - name: Run golangci-lint for netpol - working-directory: hack/netpol - run: make golangci - - bin: - needs: check-changes - if: ${{ needs.check-changes.outputs.has_changes == 'yes' }} - name: Build Antrea and antctl binaries - runs-on: [ubuntu-latest] - steps: - - name: Check-out code - uses: actions/checkout@v3 - - name: Set up Go using version from go.mod - uses: actions/setup-go@v3 - with: - go-version-file: 'go.mod' - - uses: actions/cache@v3 - with: - # In order: - # * Module download cache - # * Build cache (Linux) - # * Build cache (Mac) - path: | - ~/go/pkg/mod - ~/.cache/go-build - ~/Library/Caches/go-build - %LocalAppData%\go-build - key: ${{ runner.os }}-${{ env.go-cache-name }}-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-${{ env.go-cache-name }}- - - name: Build Antrea binaries for amd64 - run: GOARCH=amd64 make bin - - name: Build Antrea binaries for arm64 - run: GOARCH=arm64 make bin - - name: Build Antrea binaries for arm - run: GOARCH=arm make bin - - name: Build antctl binaries - run: make antctl - - name: Build Multi-cluster binaries - run: | - cd multicluster - make bin - - windows-bin: - needs: check-changes - if: ${{ needs.check-changes.outputs.has_changes == 'yes' }} - name: Build Antrea Windows binaries - runs-on: [ubuntu-latest] - steps: - - name: Check-out code - uses: actions/checkout@v3 - - name: Set up Go using version from go.mod - uses: actions/setup-go@v3 - with: - go-version-file: 'go.mod' - - uses: actions/cache@v3 - with: - # In order: - # * Module download cache - # * Build cache (Linux) - # * Build cache (Mac) - path: | - ~/go/pkg/mod - ~/.cache/go-build - ~/Library/Caches/go-build - %LocalAppData%\go-build - key: ${{ runner.os }}-${{ env.go-cache-name }}-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-${{ env.go-cache-name }}- - - name: Build Antrea windows binaries - run: make windows-bin - - tidy-codegen-manifest: - needs: check-changes - if: ${{ needs.check-changes.outputs.has_changes == 'yes' }} - name: Check tidy, code generation and manifest - runs-on: [ubuntu-latest] - steps: - - name: Check-out code - uses: actions/checkout@v3 - - name: Set up Go using version from go.mod - uses: actions/setup-go@v3 - with: - go-version-file: 'go.mod' - # tidy check need to be run before code generation which will regenerate codes. - - name: Check tidy - run: make test-tidy - - name: Check code generation - run: ./ci/check-codegen.sh - - name: Check manifest - run: ./ci/check-manifest.sh - - name: Check copyright - run: ./ci/check-copyright.sh - - verify: - name: Verify docs and spelling - runs-on: [ubuntu-latest] - steps: - - name: Check-out code - uses: actions/checkout@v3 - - name: Set up Go using version from go.mod - uses: actions/setup-go@v3 - with: - go-version-file: 'go.mod' - - name: Run verify scripts - run: make verify - - name: Checking for broken Markdown links - if: ${{ github.event_name == 'pull_request' }} - uses: gaurav-nelson/github-action-markdown-link-check@v1 - with: - # Check modified files only for pull requests. Cronjob "Verify docs" takes care of checking all markdown files. - check-modified-files-only: yes - base-branch: ${{ github.base_ref }} - config-file: 'hack/.md_links_config.json' - - name: Markdownlint - run: | - sudo npm install -g markdownlint-cli@0.31.1 - make markdownlint - - name: Checking whether autogenerated Helm chart documentation is up-to-date - working-directory: build/charts/ - run: | - make helm-docs - DIFF=$(git diff .) - if [ -n "$DIFF" ]; then - echo "The Helm chart documentation is out-of-date; please run 'make helm-docs' in 'build/charts/' and commit the changes" - exit 1 - fi - - benchmark: - needs: check-changes - if: ${{ needs.check-changes.outputs.has_changes == 'yes' }} - name: Go benchmark test - runs-on: [ubuntu-latest] - steps: - - name: Check-out code - uses: actions/checkout@v3 - - name: Set up Go using version from go.mod - uses: actions/setup-go@v3 - with: - go-version-file: 'go.mod' - - name: Run Go benchmark test - run: go test -run '^$' -bench . -benchtime 1x -timeout 10m -cpu 4 -v -benchmem ./pkg/... + fail_ci_if_error: true diff --git a/.github/workflows/golicense.yml b/.github/workflows/golicense.yml deleted file mode 100644 index fb5518fa222..00000000000 --- a/.github/workflows/golicense.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Golicense -on: - pull_request: - branches: - - main - - release-* - - feature/* - push: - branches: - - main - - release-* - - feature/* - release: - types: [published] - -jobs: - check-changes: - name: Check whether tests need to be run based on diff - runs-on: [ubuntu-latest] - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: antrea-io/has-changes@v2 - id: check_diff - with: - paths-ignore: docs/* ci/jenkins/* *.md hack/.notableofcontents - outputs: - has_changes: ${{ steps.check_diff.outputs.has_changes }} - - golicense: - needs: check-changes - if: ${{ needs.check-changes.outputs.has_changes == 'yes' || github.event_name != 'pull_request' }} - runs-on: [ubuntu-latest] - steps: - - uses: actions/checkout@v3 - - name: Set up Go using version from go.mod - uses: actions/setup-go@v3 - with: - go-version-file: 'go.mod' - - name: Cache licensing information for dependencies - uses: actions/cache@v3 - id: cache - env: - cache-name: cache-lichen-deps-licensing-info - with: - path: license-reports - key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/go.sum', 'ci/golicense/**') }} - - run: mkdir antrea-bins - - name: Build assets - run: | - export VERSION="$(head VERSION)" - ./hack/release/prepare-assets.sh ./antrea-bins - - name: Build Linux binaries - run: BINDIR=./antrea-bins make bin - - name: Run lichen - if: steps.cache.outputs.cache-hit != 'true' - run: | - mkdir license-reports - ./ci/golicense/run.sh ./antrea-bins ./license-reports - - name: Upload licensing information - if: ${{ always() }} - uses: actions/upload-artifact@v3 - with: - name: licenses.deps - path: license-reports/ALL.deps.txt - retention-days: 90 # max value diff --git a/.github/workflows/kind.yml b/.github/workflows/kind.yml deleted file mode 100644 index 8fb5325f80e..00000000000 --- a/.github/workflows/kind.yml +++ /dev/null @@ -1,696 +0,0 @@ -name: Kind -on: - pull_request: - branches: - - main - - release-* - - feature/* - push: - branches: - - main - - release-* - - feature/* - -env: - KIND_VERSION: v0.12.0 - -jobs: - check-changes: - name: Check whether tests need to be run based on diff - runs-on: [ubuntu-latest] - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: antrea-io/has-changes@v2 - id: check_diff - with: - paths-ignore: docs/* ci/jenkins/* *.md hack/.notableofcontents plugins/* - outputs: - has_changes: ${{ steps.check_diff.outputs.has_changes }} - - build-antrea-coverage-image: - name: Build Antrea image to be used for Kind e2e tests - needs: check-changes - if: ${{ needs.check-changes.outputs.has_changes == 'yes' }} - runs-on: [ubuntu-latest] - steps: - - uses: actions/checkout@v3 - - 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@v3 - with: - name: antrea-ubuntu-cov - path: antrea-ubuntu.tar - retention-days: 1 # minimum value, in case artifact deletion by 'artifact-cleanup' job fails - - build-flow-aggregator-coverage-image: - name: Build Flow Aggregator image to be used for Kind e2e tests - needs: check-changes - if: ${{ needs.check-changes.outputs.has_changes == 'yes' }} - runs-on: [ ubuntu-latest ] - steps: - - uses: actions/checkout@v3 - - run: make flow-aggregator-ubuntu-coverage - - name: Save Flow Aggregator image to tarball - run: docker save -o flow-aggregator.tar antrea/flow-aggregator-coverage:latest - - name: Upload Flow Aggregator image for subsequent jobs - uses: actions/upload-artifact@v3 - with: - name: flow-aggregator-cov - path: flow-aggregator.tar - retention-days: 1 # minimum value, in case artifact deletion by 'artifact-cleanup' job fails - - test-e2e-encap: - name: E2e tests on a Kind cluster on Linux - 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@v3 - - uses: actions/setup-go@v3 - with: - go-version-file: 'go.mod' - - name: Download Antrea image from previous job - uses: actions/download-artifact@v3 - with: - name: antrea-ubuntu-cov - - name: Load Antrea image - run: | - docker load -i antrea-ubuntu.tar - - name: Install Kind - run: | - 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-coverage - ANTREA_LOG_DIR=$PWD/log ANTREA_COV_DIR=$PWD/test-e2e-encap-coverage ./ci/kind/test-e2e-kind.sh --encap-mode encap --coverage - - name: Tar coverage files - run: tar -czf test-e2e-encap-coverage.tar.gz test-e2e-encap-coverage - - name: Upload coverage for test-e2e-encap-coverage - uses: actions/upload-artifact@v3 - with: - name: test-e2e-encap-coverage - path: test-e2e-encap-coverage.tar.gz - retention-days: 30 - - name: Codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: '*.cov.out*' - flags: kind-e2e-tests - name: codecov-test-e2e-encap - directory: test-e2e-encap-coverage - fail_ci_if_error: ${{ github.event_name == 'push' }} - - name: Tar log files - if: ${{ failure() }} - run: tar -czf log.tar.gz log - - name: Upload test log - uses: actions/upload-artifact@v3 - if: ${{ failure() }} - with: - name: e2e-kind-encap.tar.gz - path: log.tar.gz - retention-days: 30 - - test-e2e-encap-no-proxy: - name: E2e tests on a Kind cluster on Linux with AntreaProxy disabled - 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@v3 - - uses: actions/setup-go@v3 - with: - go-version-file: 'go.mod' - - name: Download Antrea image from previous job - uses: actions/download-artifact@v3 - with: - name: antrea-ubuntu-cov - - name: Load Antrea image - run: | - docker load -i antrea-ubuntu.tar - - name: Install Kind - run: | - 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-no-proxy-coverage - ANTREA_LOG_DIR=$PWD/log ANTREA_COV_DIR=$PWD/test-e2e-encap-no-proxy-coverage ./ci/kind/test-e2e-kind.sh --encap-mode encap --feature-gates AntreaProxy=false --coverage --skip mode-irrelevant - - name: Tar coverage files - run: tar -czf test-e2e-encap-no-proxy-coverage.tar.gz test-e2e-encap-no-proxy-coverage - - name: Upload coverage for test-e2e-encap-no-proxy-coverage - uses: actions/upload-artifact@v3 - with: - name: test-e2e-encap-no-proxy-coverage - path: test-e2e-encap-no-proxy-coverage.tar.gz - retention-days: 30 - - name: Codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: '*.cov.out*' - flags: kind-e2e-tests - name: codecov-test-e2e-encap-no-proxy - directory: test-e2e-encap-no-proxy-coverage - fail_ci_if_error: ${{ github.event_name == 'push' }} - - name: Tar log files - if: ${{ failure() }} - run: tar -czf log.tar.gz log - - name: Upload test log - uses: actions/upload-artifact@v3 - if: ${{ failure() }} - with: - name: e2e-kind-encap-no-proxy.tar.gz - path: log.tar.gz - retention-days: 30 - - 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@v3 - - uses: actions/setup-go@v3 - with: - go-version-file: 'go.mod' - - name: Download Antrea image from previous job - uses: actions/download-artifact@v3 - with: - name: antrea-ubuntu-cov - - name: Load Antrea image - run: | - docker load -i antrea-ubuntu.tar - - name: Install Kind - run: | - 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 - # Currently multicast tests require specific testbeds, exclude it for now. - 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,Multicast=false --proxy-all - - name: Tar coverage files - run: tar -czf test-e2e-encap-all-features-enabled-coverage.tar.gz test-e2e-encap-all-features-enabled-coverage - - name: Upload coverage for test-e2e-encap-all-features-enabled-coverage - uses: actions/upload-artifact@v3 - with: - name: test-e2e-encap-all-features-enabled-coverage - path: test-e2e-encap-all-features-enabled-coverage.tar.gz - retention-days: 30 - - name: Codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: '*.cov.out*' - flags: kind-e2e-tests - name: codecov-test-e2e-encap-all-features-enabled - directory: test-e2e-encap-all-features-enabled-coverage - fail_ci_if_error: ${{ github.event_name == 'push' }} - - name: Tar log files - if: ${{ failure() }} - run: tar -czf log.tar.gz log - - name: Upload test log - uses: actions/upload-artifact@v3 - if: ${{ failure() }} - with: - name: e2e-kind-encap-all-features-enabled.tar.gz - path: log.tar.gz - retention-days: 30 - - test-e2e-noencap: - name: E2e tests on a Kind cluster on Linux (noEncap) - 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@v3 - - uses: actions/setup-go@v3 - with: - go-version-file: 'go.mod' - - name: Download Antrea image from previous job - uses: actions/download-artifact@v3 - with: - name: antrea-ubuntu-cov - - name: Load Antrea image - run: | - docker load -i antrea-ubuntu.tar - - name: Install Kind - run: | - 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-noencap-coverage - ANTREA_LOG_DIR=$PWD/log ANTREA_COV_DIR=$PWD/test-e2e-noencap-coverage ./ci/kind/test-e2e-kind.sh --encap-mode noEncap --coverage --skip mode-irrelevant - - name: Tar coverage files - run: tar -czf test-e2e-noencap-coverage.tar.gz test-e2e-noencap-coverage - - name: Upload coverage for test-e2e-noencap-coverage - uses: actions/upload-artifact@v3 - with: - name: test-e2e-noencap-coverage - path: test-e2e-noencap-coverage.tar.gz - retention-days: 30 - - name: Codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: '*.cov.out*' - flags: kind-e2e-tests - name: codecov-test-e2e-noencap - directory: test-e2e-noencap-coverage - fail_ci_if_error: ${{ github.event_name == 'push' }} - - name: Tar log files - if: ${{ failure() }} - run: tar -czf log.tar.gz log - - name: Upload test log - uses: actions/upload-artifact@v3 - if: ${{ failure() }} - with: - name: e2e-kind-noencap.tar.gz - path: log.tar.gz - retention-days: 30 - - test-e2e-hybrid: - name: E2e tests on a Kind cluster on Linux (hybrid) - 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@v3 - - uses: actions/setup-go@v3 - with: - go-version-file: 'go.mod' - - name: Download Antrea image from previous job - uses: actions/download-artifact@v3 - with: - name: antrea-ubuntu-cov - - name: Load Antrea image - run: | - docker load -i antrea-ubuntu.tar - - name: Install Kind - run: | - 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-hybrid-coverage - ANTREA_LOG_DIR=$PWD/log ANTREA_COV_DIR=$PWD/test-e2e-hybrid-coverage ./ci/kind/test-e2e-kind.sh --encap-mode hybrid --coverage --skip mode-irrelevant - - name: Tar coverage files - run: tar -czf test-e2e-hybrid-coverage.tar.gz test-e2e-hybrid-coverage - - name: Upload coverage for test-e2e-hybrid-coverage - uses: actions/upload-artifact@v3 - with: - name: test-e2e-hybrid-coverage - path: test-e2e-hybrid-coverage.tar.gz - retention-days: 30 - - name: Codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: '*.cov.out*' - flags: kind-e2e-tests - name: codecov-test-e2e-hybrid - directory: test-e2e-hybrid-coverage - fail_ci_if_error: ${{ github.event_name == 'push' }} - - name: Tar log files - if: ${{ failure() }} - run: tar -czf log.tar.gz log - - name: Upload test log - uses: actions/upload-artifact@v3 - if: ${{ failure() }} - with: - name: e2e-kind-hybrid.tar.gz - path: log.tar.gz - retention-days: 30 - - test-e2e-flow-visibility: - name: E2e tests on a Kind cluster on Linux for Flow Visibility - needs: [build-antrea-coverage-image, build-flow-aggregator-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@v3 - - uses: actions/setup-go@v3 - with: - go-version-file: 'go.mod' - - name: Download Antrea image from previous job - uses: actions/download-artifact@v3 - with: - name: antrea-ubuntu-cov - - name: Load Antrea image - run: | - docker load -i antrea-ubuntu.tar - - name: Download Flow Aggregator image from previous job - uses: actions/download-artifact@v3 - with: - name: flow-aggregator-cov - - name: Load Flow Aggregator image - run: | - docker load -i flow-aggregator.tar - - name: Install Kind - run: | - 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-fa-coverage - ANTREA_LOG_DIR=$PWD/log ANTREA_COV_DIR=$PWD/test-e2e-fa-coverage ./ci/kind/test-e2e-kind.sh --encap-mode encap --coverage --flow-visibility - - name: Tar coverage files - run: tar -czf test-e2e-fa-coverage.tar.gz test-e2e-fa-coverage - - name: Upload coverage for test-e2e-fa-coverage - uses: actions/upload-artifact@v3 - with: - name: test-e2e-fa-coverage - path: test-e2e-fa-coverage.tar.gz - retention-days: 30 - - name: Codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: '*.cov.out*' - flags: kind-e2e-tests - name: codecov-test-e2e-fa - directory: test-e2e-fa-coverage - fail_ci_if_error: ${{ github.event_name == 'push' }} - - name: Tar log files - if: ${{ failure() }} - run: tar -czf log.tar.gz log - - name: Upload test log - uses: actions/upload-artifact@v3 - if: ${{ failure() }} - with: - name: e2e-kind-fa.tar.gz - path: log.tar.gz - retention-days: 30 - - test-upgrade-from-N-1: - name: Upgrade from Antrea version N-1 - 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@v3 - - uses: actions/setup-go@v3 - with: - go-version-file: 'go.mod' - - name: Download Antrea image from previous job - uses: actions/download-artifact@v3 - with: - name: antrea-ubuntu-cov - - name: Load Antrea image - run: | - docker load -i antrea-ubuntu.tar - docker tag antrea/antrea-ubuntu-coverage:latest antrea/antrea-ubuntu:latest - - name: Install Kind - run: | - 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 test - run: | - mkdir log - ANTREA_LOG_DIR=$PWD/log ./ci/kind/test-upgrade-antrea.sh --from-version-n-minus 1 - - name: Tar log files - if: ${{ failure() }} - run: tar -czf log.tar.gz log - - name: Upload test log - uses: actions/upload-artifact@v3 - if: ${{ failure() }} - with: - name: upgrade-from-antrea-version-n-1.tar.gz - path: log.tar.gz - retention-days: 30 - - test-upgrade-from-N-2: - name: Upgrade from Antrea version N-2 - 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@v3 - - uses: actions/setup-go@v3 - with: - go-version-file: 'go.mod' - - name: Download Antrea image from previous job - uses: actions/download-artifact@v3 - with: - name: antrea-ubuntu-cov - - name: Load Antrea image - run: | - docker load -i antrea-ubuntu.tar - docker tag antrea/antrea-ubuntu-coverage:latest antrea/antrea-ubuntu:latest - - name: Install Kind - run: | - 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 test - run: | - mkdir log - ANTREA_LOG_DIR=$PWD/log ./ci/kind/test-upgrade-antrea.sh --from-version-n-minus 2 - - name: Tar log files - if: ${{ failure() }} - run: tar -czf log.tar.gz log - - name: Upload test log - uses: actions/upload-artifact@v3 - if: ${{ failure() }} - with: - name: upgrade-from-antrea-version-n-2.tar.gz - path: log.tar.gz - retention-days: 30 - - test-compatible-N-1: - name: API compatible with client version N-1 - 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@v3 - - uses: actions/setup-go@v3 - with: - go-version-file: 'go.mod' - - name: Download Antrea image from previous job - uses: actions/download-artifact@v3 - with: - name: antrea-ubuntu-cov - - name: Load Antrea image - run: | - docker load -i antrea-ubuntu.tar - docker tag antrea/antrea-ubuntu-coverage:latest antrea/antrea-ubuntu:latest - - name: Install Kind - run: | - 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 test - run: | - mkdir log - ANTREA_LOG_DIR=$PWD/log ./ci/kind/test-upgrade-antrea.sh --from-version-n-minus 1 --controller-only - - name: Tar log files - if: ${{ failure() }} - run: tar -czf log.tar.gz log - - name: Upload test log - uses: actions/upload-artifact@v3 - if: ${{ failure() }} - with: - name: api-compatible-with-client-version-n-1.tar.gz - path: log.tar.gz - retention-days: 30 - - test-compatible-N-2: - name: API compatible with client version N-2 - 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@v3 - - uses: actions/setup-go@v3 - with: - go-version-file: 'go.mod' - - name: Download Antrea image from previous job - uses: actions/download-artifact@v3 - with: - name: antrea-ubuntu-cov - - name: Load Antrea image - run: | - docker load -i antrea-ubuntu.tar - docker tag antrea/antrea-ubuntu-coverage:latest antrea/antrea-ubuntu:latest - - name: Install Kind - run: | - 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 test - run: | - mkdir log - ANTREA_LOG_DIR=$PWD/log ./ci/kind/test-upgrade-antrea.sh --from-version-n-minus 2 --controller-only - - name: Tar log files - if: ${{ failure() }} - run: tar -czf log.tar.gz log - - name: Upload test log - uses: actions/upload-artifact@v3 - if: ${{ failure() }} - with: - name: api-compatible-with-client-version-n-2.tar.gz - path: log.tar.gz - retention-days: 30 - - test-netpol-tmp: - name: Run experimental network policy tests (netpol) on Kind cluster - 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@v3 - - uses: actions/setup-go@v3 - with: - go-version-file: 'go.mod' - - name: Download Antrea image from previous job - uses: actions/download-artifact@v3 - with: - name: antrea-ubuntu-cov - - name: Load Antrea image - run: | - docker load -i antrea-ubuntu.tar - docker tag antrea/antrea-ubuntu-coverage:latest antrea/antrea-ubuntu:latest - - name: Install Kind - run: | - 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: Build netpol Docker image - working-directory: hack/netpol - run: make - - name: Run netpol tests - working-directory: hack/netpol - run: ./test-kind.sh - - validate-prometheus-metrics-doc: - name: Validate metrics in Prometheus document match running deployment's - 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@v3 - - uses: actions/setup-go@v3 - with: - go-version-file: 'go.mod' - - name: Download Antrea image from previous job - uses: actions/download-artifact@v3 - with: - name: antrea-ubuntu-cov - - name: Load Antrea image - run: | - docker load -i antrea-ubuntu.tar - docker tag antrea/antrea-ubuntu-coverage:latest antrea/antrea-ubuntu:latest - - name: Install Kind - run: | - 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: Validate document - run: | - ./ci/kind/validate-metrics-doc.sh - - # 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 - - build-flow-aggregator-coverage-image - - test-e2e-encap - - test-e2e-encap-no-proxy - - test-e2e-encap-all-features-enabled - - test-e2e-noencap - - test-e2e-hybrid - - test-upgrade-from-N-1 - - test-upgrade-from-N-2 - - test-compatible-N-1 - - test-compatible-N-2 - - test-netpol-tmp - - validate-prometheus-metrics-doc - - test-e2e-flow-visibility - 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 - - name: Delete flow-aggregator - if: ${{ needs.build-flow-aggregator-coverage-image.result == 'success' }} - uses: geekyeggo/delete-artifact@v2 - with: - name: flow-aggregator-cov - failOnError: false diff --git a/codecov.yaml b/codecov.yaml index e946dd107ae..d55557257ff 100644 --- a/codecov.yaml +++ b/codecov.yaml @@ -2,14 +2,7 @@ codecov: branch: main require_ci_to_pass: no -comment: - layout: "reach,diff,flags,tree" - behavior: default - require_changes: no - require_base: no - require_head: no - after_n_builds: 1 - show_carryforward_flags: true +comment: false github_checks: annotations: true @@ -31,22 +24,10 @@ coverage: target: auto flags: - unit-tests - antrea-integration-tests: - target: auto - flags: - - integration-tests - antrea-e2e-tests: - target: auto - flags: - - e2e-tests - antrea-kind-e2e-tests: - target: auto - flags: - - kind-e2e-tests flag_management: default_rules: - carryforward: true + carryforward: false ignore: - "**/testing/*.go"