diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 69e98a72310..00000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,197 +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@v4 - with: - fetch-depth: 0 - show-progress: false - - 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@v4 - with: - show-progress: false - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@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-controller-ubuntu:latest antrea/antrea-controller-ubuntu-amd64:latest - docker tag antrea/antrea-agent-ubuntu:latest antrea/antrea-agent-ubuntu-amd64:latest - docker push antrea/antrea-controller-ubuntu-amd64:latest - docker push antrea/antrea-agent-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: - - 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 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - uses: actions/setup-go@v5 - with: - go-version-file: 'go.mod' - - name: Build Antrea UBI9 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 UBI9 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-agent-ubi:latest - docker push antrea/antrea-controller-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@v4 - with: - show-progress: false - - 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: [ubuntu-latest] - steps: - - uses: actions/checkout@v4 - with: - show-progress: false - - name: Build Antrea Windows Docker image - if: ${{ github.repository != 'antrea-io/antrea' || github.event_name != 'push' || github.ref != 'refs/heads/main' }} - run: ./hack/build-antrea-windows-all.sh --pull - - 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 - ./hack/build-antrea-windows-all.sh --pull --push --push-base-images - shell: bash - - 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@v4 - with: - show-progress: false - - name: Build antrea-mc-controller Docker image - run: make build-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-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@v4 - with: - show-progress: false - - 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 - - build-antrea-migrator: - needs: check-changes - if: ${{ needs.check-changes.outputs.has_changes == 'yes' || github.event_name == 'push' }} - runs-on: [ubuntu-latest] - steps: - - uses: actions/checkout@v4 - with: - show-progress: false - - name: Build antrea-migrator Docker image - run: make build-migrator - - name: Push antrea-migrator 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-migrator:latest diff --git a/.github/workflows/conformance.yml b/.github/workflows/conformance.yml deleted file mode 100644 index af97debaf7c..00000000000 --- a/.github/workflows/conformance.yml +++ /dev/null @@ -1,118 +0,0 @@ -name: Manually run upstream conformance test on Linux -run-name: Run ${{ inputs.test-suite }} test with Antrea ${{ inputs.antrea-version }} and K8s ${{ inputs.k8s-version }} - -on: - workflow_dispatch: - inputs: - antrea-version: - description: The Antrea version to test. It could be a SHA-1 value, a branch, or a tag (e.g. a7b012b, release-1.12, v1.12.0). The main branch will be used if empty. - required: false - antrea-values: - description: The Antrea Chart values. Multiple values can be separated with commas (e.g. key1=val1,key2=val2). Default configuration will be tested if empty. - required: false - antrea-image-distro: - description: The Antrea image distribution to test. It could be ubuntu or ubi. - type: choice - options: - - ubuntu - - ubi - default: ubuntu - k8s-version: - description: The K8s version (e.g. v1.27.1) to test. Kind's default K8s version will be used if empty. - required: false - test-suite: - description: The test suite to run. Check run-k8s-e2e-tests.sh for which test cases these values represent. - type: choice - options: - - whole-conformance - - conformance - - network-policy - - sig-network - - all - default: whole-conformance - required: true - always-upload-logs: - description: Always upload logs regardless of the test result. - type: boolean - default: false - - -jobs: - test: - name: Run tests - 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: - ref: ${{ inputs.antrea-version }} - fetch-depth: 0 - show-progress: false - - name: Check if it is a released version - id: check-release - run: | - if git show-ref --tags --verify --quiet refs/tags/${{ inputs.antrea-version }}; then - echo "released=true" >> $GITHUB_OUTPUT - echo "image-tag=${{ inputs.antrea-version }}" >> $GITHUB_OUTPUT - else - echo "released=false" >> $GITHUB_OUTPUT - echo "image-tag=latest" >> $GITHUB_OUTPUT - fi - - name: Set up Docker Buildx if required - if: ${{ steps.check-release.outputs.released == 'false' }} - uses: docker/setup-buildx-action@v3 - - name: Build Antrea image if required - if: ${{ steps.check-release.outputs.released == 'false' }} - run: | - ./hack/build-antrea-linux-all.sh --pull --distro ${{ inputs.antrea-image-distro }} - - name: Install Kind - run: | - KIND_VERSION=$(head -n1 ./ci/kind/version || echo v0.20.0) - 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: Create K8s cluster - run: | - # If an image does not exist (unified vs split), a warning will be printed, but the script - # execution will not fail. - images=() - images+=(antrea/antrea-controller-${{ inputs.antrea-image-distro }}:${{ steps.check-release.outputs.image-tag }}) - images+=(antrea/antrea-agent-${{ inputs.antrea-image-distro }}:${{ steps.check-release.outputs.image-tag }}) - images+=(antrea/antrea-${{ inputs.antrea-image-distro }}:${{ steps.check-release.outputs.image-tag }}) - ./ci/kind/kind-setup.sh create kind \ - --k8s-version "${{ inputs.k8s-version }}" \ - --images "${images[*]}" - - name: Install Antrea - run: | - helm_args=() - helm_repo="./build/charts/antrea" - if [ ${{ steps.check-release.outputs.released }} == 'true' ]; then - helm_repo="antrea/antrea" - helm_args+=(--version "${{ inputs.antrea-version }}") - helm repo add antrea https://charts.antrea.io - helm repo update - fi - if helm show values ${helm_repo} | grep -q '^controllerImage:'; then - helm_args+=(--set controllerImage.repository="antrea/antrea-controller-${{ inputs.antrea-image-distro }}") - helm_args+=(--set agentImage.repository="antrea/antrea-agent-${{ inputs.antrea-image-distro }}") - else - helm_args+=(--set image.repository="antrea/antrea-${{ inputs.antrea-image-distro }}") - fi - helm install --namespace kube-system antrea ${helm_repo} \ - --set "${{ inputs.antrea-values }}" \ - "${helm_args[@]}" - kubectl rollout status -n kube-system ds/antrea-agent --timeout=5m - - name: Run e2e tests - run: | - ./ci/run-k8s-e2e-tests.sh "--e2e-${{ inputs.test-suite }}" - - name: Upload test log - uses: actions/upload-artifact@v4 - if: ${{ failure() || inputs.always-upload-logs }} - with: - name: sonobuoy.tar.gz - path: "*_sonobuoy_*.tar.gz" - retention-days: 7 diff --git a/.github/workflows/golicense.yml b/.github/workflows/golicense.yml deleted file mode 100644 index d9cfce74a05..00000000000 --- a/.github/workflows/golicense.yml +++ /dev/null @@ -1,70 +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@v4 - with: - fetch-depth: 0 - show-progress: false - - 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@v4 - with: - show-progress: false - - name: Set up Go using version from go.mod - uses: actions/setup-go@v5 - with: - go-version-file: 'go.mod' - - name: Cache licensing information for dependencies - uses: actions/cache@v4 - 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@v4 - 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 a7d0d08e250..00000000000 --- a/.github/workflows/kind.yml +++ /dev/null @@ -1,865 +0,0 @@ -name: Kind -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@v4 - with: - fetch-depth: 0 - show-progress: false - - 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@v4 - with: - show-progress: false - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@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-agent-ubuntu-coverage:latest antrea/antrea-controller-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 - - 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@v4 - with: - show-progress: false - - 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@v4 - 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@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-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@v4 - 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@v4 - if: ${{ failure() }} - with: - name: e2e-kind-encap.tar.gz - path: log.tar.gz - retention-days: 30 - - test-e2e-encap-non-default: - name: E2e tests on a Kind cluster on Linux with non default values (proxyAll=true, LoadBalancerMode=DSR, NodeIPAM=true) - 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-non-default-coverage - ANTREA_LOG_DIR=$PWD/log ANTREA_COV_DIR=$PWD/test-e2e-encap-non-default-coverage ./ci/kind/test-e2e-kind.sh \ - --coverage \ - --encap-mode encap \ - --proxy-all \ - --feature-gates LoadBalancerModeDSR=true \ - --load-balancer-mode dsr \ - --node-ipam - - name: Tar coverage files - run: tar -czf test-e2e-encap-non-default-coverage.tar.gz test-e2e-encap-non-default-coverage - - name: Upload coverage for test-e2e-encap-non-default-coverage - uses: actions/upload-artifact@v4 - with: - name: test-e2e-encap-non-default-coverage - path: test-e2e-encap-non-default-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-non-default - directory: test-e2e-encap-non-default-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@v4 - if: ${{ failure() }} - with: - name: e2e-kind-encap-non-default.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@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 \ - --extra-vlan \ - --multicast \ - --networkpolicy-evaluation - - 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@v4 - 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@v4 - 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@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-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@v4 - 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@v4 - 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@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-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@v4 - 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@v4 - 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 - sudo rm -rf /usr/share/dotnet - sudo rm -rf /opt/ghc - sudo rm -rf "/usr/local/share/boost" - sudo rm -rf "$AGENT_TOOLSDIRECTORY" - sudo rm -rf "/usr/local/lib/android" - 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: Download Flow Aggregator image from previous job - uses: actions/download-artifact@v4 - with: - name: flow-aggregator-cov - - name: Load Flow Aggregator image - run: | - docker load -i flow-aggregator.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-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 --ip-family dual - - 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@v4 - 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@v4 - if: ${{ failure() }} - with: - name: e2e-kind-fa.tar.gz - path: log.tar.gz - retention-days: 30 - - test-network-policy-conformance-encap: - name: NetworkPolicy conformance 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@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 - docker tag antrea/antrea-agent-ubuntu-coverage:latest antrea/antrea-agent-ubuntu:latest - docker tag antrea/antrea-controller-ubuntu-coverage:latest antrea/antrea-controller-ubuntu:latest - - 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 NetworkPolicy conformance tests - run: | - mkdir log - ANTREA_LOG_DIR=$PWD/log ./ci/kind/test-netpol-v2-conformance-kind.sh - - name: Tar log files - if: ${{ failure() }} - run: tar -czf log.tar.gz log - - name: Upload test log - uses: actions/upload-artifact@v4 - if: ${{ failure() }} - with: - name: networkpolicy-conformance-kind-encap.tar.gz - path: log.tar.gz - retention-days: 30 - - test-secondary-network: - name: Antrea-native (VLAN) secondary network 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@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 - docker tag antrea/antrea-agent-ubuntu-coverage:latest antrea/antrea-agent-ubuntu:latest - docker tag antrea/antrea-controller-ubuntu-coverage:latest antrea/antrea-controller-ubuntu:latest - - 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 secondary network tests - run: | - mkdir log - ANTREA_LOG_DIR=$PWD/log ./ci/kind/test-secondary-network-kind.sh - - name: Tar log files - if: ${{ failure() }} - run: tar -czf log.tar.gz log - - name: Upload test log - uses: actions/upload-artifact@v4 - if: ${{ failure() }} - with: - name: secondary-network.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@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 - docker tag antrea/antrea-agent-ubuntu-coverage:latest antrea/antrea-agent-ubuntu:latest - docker tag antrea/antrea-controller-ubuntu-coverage:latest antrea/antrea-controller-ubuntu:latest - - 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 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@v4 - 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@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 - docker tag antrea/antrea-agent-ubuntu-coverage:latest antrea/antrea-agent-ubuntu:latest - docker tag antrea/antrea-controller-ubuntu-coverage:latest antrea/antrea-controller-ubuntu:latest - - 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 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@v4 - 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@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 - docker tag antrea/antrea-agent-ubuntu-coverage:latest antrea/antrea-agent-ubuntu:latest - docker tag antrea/antrea-controller-ubuntu-coverage:latest antrea/antrea-controller-ubuntu:latest - - 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 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@v4 - 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@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 - docker tag antrea/antrea-agent-ubuntu-coverage:latest antrea/antrea-agent-ubuntu:latest - docker tag antrea/antrea-controller-ubuntu-coverage:latest antrea/antrea-controller-ubuntu:latest - - 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 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@v4 - if: ${{ failure() }} - with: - name: api-compatible-with-client-version-n-2.tar.gz - path: log.tar.gz - retention-days: 30 - - run-installation-checks: - name: Test installation using 'antctl check' command - needs: [ build-antrea-coverage-image ] - runs-on: [ ubuntu-latest ] - steps: - - name: Free disk space - 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: Create Kind Cluster - run: | - ./ci/kind/kind-setup.sh create kind --ip-family dual - - name: Build antctl binary - run: | - make antctl-linux - - name: Run Pre checks - run: | - ./bin/antctl-linux check cluster - - name: Deploy Antrea - run: | - kubectl apply -f build/yamls/antrea.yml - - name: Run Post checks - run: | - ./bin/antctl-linux check installation - - 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@v4 - with: - show-progress: false - - 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 - docker tag antrea/antrea-agent-ubuntu-coverage:latest antrea/antrea-agent-ubuntu:latest - docker tag antrea/antrea-controller-ubuntu-coverage:latest antrea/antrea-controller-ubuntu:latest - - 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: 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. There is no simple way to delete an artifact from a worfklow triggered by a pull - # request, so instead we use the upload-artifact action again, and overwrite the previous artifact - # (which is very large) with an empty file. - artifact-cleanup: - name: Delete uploaded images - needs: - - build-antrea-coverage-image - - build-flow-aggregator-coverage-image - - test-e2e-encap - - test-e2e-encap-non-default - - 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 - - validate-prometheus-metrics-doc - - test-e2e-flow-visibility - - test-network-policy-conformance-encap - - run-installation-checks - runs-on: [ubuntu-latest] - steps: - - name: Create empty file to overwrite artifacts - run: | - touch empty-artifact - - name: Delete antrea-ubuntu-cov - if: ${{ needs.build-antrea-coverage-image.result == 'success' }} - uses: actions/upload-artifact@v4 - with: - name: antrea-ubuntu-cov - path: empty-artifact - retention-days: 1 # minimum value - overwrite: true - - name: Delete flow-aggregator - if: ${{ needs.build-flow-aggregator-coverage-image.result == 'success' }} - uses: actions/upload-artifact@v4 - with: - name: flow-aggregator-cov - path: empty-artifact - retention-days: 1 # minimum value - overwrite: true diff --git a/codecov.yaml b/codecov.yaml index f1b7a3f57f6..d7fd34d62a0 100644 --- a/codecov.yaml +++ b/codecov.yaml @@ -37,10 +37,9 @@ coverage: flags: - unit-tests - flag_management: default_rules: - carryforward: true + carryforward: false # Exclude files from being collected by Codecov. Ignored files will be skipped during processing. ignore: