From 3b466d2de935101d5df42b564038a9f7c5c03cc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=A5=96=E5=BB=BA?= Date: Mon, 20 Feb 2023 11:04:42 +0800 Subject: [PATCH] simplify github actions workflows (#2338) --- .github/workflows/build-arm64-image.yaml | 19 +- .github/workflows/build-dpdk-image.yaml | 2 +- .github/workflows/build-kube-ovn-debug.yaml | 9 +- .github/workflows/build-windows.yaml | 52 +++++- .github/workflows/build-x86-image.yaml | 189 +++++++++----------- .github/workflows/lint.yaml | 6 +- .github/workflows/scheduled-e2e.yaml | 134 ++++++-------- 7 files changed, 195 insertions(+), 216 deletions(-) diff --git a/.github/workflows/build-arm64-image.yaml b/.github/workflows/build-arm64-image.yaml index a795e9fb653..5e1537f14ab 100644 --- a/.github/workflows/build-arm64-image.yaml +++ b/.github/workflows/build-arm64-image.yaml @@ -14,13 +14,10 @@ on: - 'docs/**' - '**.md' -concurrency: +concurrency: group: "${{ github.workflow }}-${{ github.ref }}" cancel-in-progress: true -env: - GO_VERSION: '1.20' - jobs: build: name: Build arm64 @@ -34,13 +31,11 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: '${{ env.GO_VERSION }}' + go-version-file: go.mod check-latest: true - id: go - name: Export Go full version - run: | - echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV" + run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV" - name: Go Cache uses: actions/cache@v3 @@ -49,15 +44,13 @@ jobs: ~/.cache/go-build ~/go/pkg/mod key: ${{ runner.os }}-${{ env.GO_FULL_VER }}-arm64-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-${{ env.GO_FULL_VER }}-arm64- + restore-keys: ${{ runner.os }}-${{ env.GO_FULL_VER }}-arm64- - name: Build - run: | - make release-arm || make release-arm + run: make release-arm || make release-arm - name: Push - if: ${{ github.ref == 'refs/heads/master' || contains(github.ref, 'release') }} + if: github.ref == github.event.repository.default_branch || startsWith(github.ref, 'release-') env: DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} diff --git a/.github/workflows/build-dpdk-image.yaml b/.github/workflows/build-dpdk-image.yaml index f6af881e7d1..0b7ff4d99a6 100644 --- a/.github/workflows/build-dpdk-image.yaml +++ b/.github/workflows/build-dpdk-image.yaml @@ -14,7 +14,7 @@ jobs: make build-dpdk - name: Push - if: ${{ github.ref == 'refs/heads/master' || contains(github.ref, 'release') }} + if: github.ref == github.event.repository.default_branch || startsWith(github.ref, 'release-') env: DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} diff --git a/.github/workflows/build-kube-ovn-debug.yaml b/.github/workflows/build-kube-ovn-debug.yaml index 9a0450db0af..e911277c256 100644 --- a/.github/workflows/build-kube-ovn-debug.yaml +++ b/.github/workflows/build-kube-ovn-debug.yaml @@ -1,9 +1,6 @@ name: Build Debug on: workflow_dispatch -env: - GO_VERSION: '1.20' - jobs: build-debug: name: Build Debug @@ -13,13 +10,11 @@ jobs: - uses: docker/setup-buildx-action@v2 - uses: actions/setup-go@v3 with: - go-version: '${{ env.GO_VERSION }}' + go-version-file: go.mod check-latest: true - id: go - name: Build - run: | - make image-debug + run: make image-debug - name: Push env: diff --git a/.github/workflows/build-windows.yaml b/.github/workflows/build-windows.yaml index e3a42954739..35936ab3718 100644 --- a/.github/workflows/build-windows.yaml +++ b/.github/workflows/build-windows.yaml @@ -1,6 +1,8 @@ name: Build Windows on: + workflow_dispatch: + release: pull_request: branches: - master @@ -20,13 +22,52 @@ concurrency: cancel-in-progress: true env: - GO_VERSION: '1.20' GOSEC_VERSION: '2.14.0' jobs: + filter: + name: Path Filter + runs-on: ubuntu-22.04 + outputs: + build-ovs-ovn: ${{ steps.filter.outputs.windows-ovs-ovn }} + build-kube-ovn: ${{ steps.filter.outputs.windows-kube-ovn }} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + with: + go-version-file: go.mod + check-latest: true + + - name: Generate path filter + env: + GOOS: windows + run: | + filter=".github/path-filters.yaml" + workflow=$(echo ${{ github.workflow_ref }} | awk -F@ '{print $1}' | sed 's@^${{ github.repository }}/@@') + cat > $filter <> $filter + done + + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: .github/path-filters.yaml + build-ovs-and-ovn: name: Build OVS and OVN + needs: + - filter runs-on: windows-2019 + if: github.event_name != 'pull_request' || needs.filter.outputs.build-ovs-ovn == 'true' steps: - name: Check out PTHREADS4W run: | @@ -127,14 +168,16 @@ jobs: build-kube-ovn: name: Build Kube-OVN + needs: + - filter runs-on: windows-2019 + if: github.event_name != 'pull_request' || needs.filter.outputs.build-kube-ovn == 'true' steps: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: '${{ env.GO_VERSION }}' + go-version-file: go.mod check-latest: true - id: go - name: Export Go full version run: | @@ -149,8 +192,7 @@ jobs: ~\AppData\Local\go-build ~\go\pkg\mod key: ${{ runner.os }}-${{ env.GO_FULL_VER }}-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-${{ env.GO_FULL_VER }}- + restore-keys: ${{ runner.os }}-${{ env.GO_FULL_VER }}- - name: Install gosec run: | diff --git a/.github/workflows/build-x86-image.yaml b/.github/workflows/build-x86-image.yaml index a556553e969..2ac1631456f 100644 --- a/.github/workflows/build-x86-image.yaml +++ b/.github/workflows/build-x86-image.yaml @@ -2,6 +2,11 @@ name: Build x86 Image on: pull_request: + types: + - opened + - synchronize + - reopened + - labeled branches: - master - release-* @@ -21,42 +26,47 @@ concurrency: cancel-in-progress: true env: - GO_VERSION: '1.20' GOSEC_VERSION: '2.14.0' - KIND_VERSION: v0.17.0 HELM_VERSION: v3.10.1 jobs: build-kube-ovn-base: name: Build kube-ovn-base runs-on: ubuntu-22.04 + outputs: + build-base: ${{ steps.build.outputs.build-base }} steps: - uses: actions/checkout@v3 with: fetch-depth: 2 + + - id: check + run: | + if [ ${{ github.event_name }} != 'pull_request' ]; then + exit + fi + if git diff --name-only HEAD^ HEAD | grep -q ^dist/images/Dockerfile.base; then + echo buildx=1 >> "$GITHUB_OUTPUT" + fi + - uses: docker/setup-buildx-action@v2 - if: github.base_ref != null + if: steps.check.outputs.buildx == 1 + - name: Build + id: build + if: steps.check.outputs.buildx == 1 run: | - touch .CI_PASSED_VAR if git diff --name-only HEAD^ HEAD | grep -q ^dist/images/Dockerfile.base$; then - echo "BUILD_BASE=1" > .CI_PASSED_VAR - echo "BUILD_BASE=1" >> "$GITHUB_ENV" make base-amd64 make base-tar-amd64 + echo build-base=1 >> "$GITHUB_OUTPUT" fi if git diff --name-only HEAD^ HEAD | grep -q ^dist/images/Dockerfile.base-dpdk$; then make base-amd64-dpdk fi - - name: Upload variable file to artifact - uses: actions/upload-artifact@v3 - with: - name: variables - path: .CI_PASSED_VAR - - name: Upload base images to artifact - if: env.BUILD_BASE == 1 + if: steps.build.outputs.build-base == 1 uses: actions/upload-artifact@v3 with: name: kube-ovn-base @@ -72,9 +82,8 @@ jobs: - uses: docker/setup-buildx-action@v2 - uses: actions/setup-go@v3 with: - go-version: '${{ env.GO_VERSION }}' + go-version-file: go.mod check-latest: true - id: go - name: Export Go full version run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV" @@ -97,22 +106,14 @@ jobs: run: | curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $(go env GOPATH)/bin 'v${{ env.GOSEC_VERSION }}' - - name: Download variable file - uses: actions/download-artifact@v3 - with: - name: variables - - - name: Export passed variables - run: cat .CI_PASSED_VAR >> "$GITHUB_ENV" - - name: Download base images - if: env.BUILD_BASE == 1 + if: needs.build-kube-ovn-base.outputs.build-base == 1 uses: actions/download-artifact@v3 with: name: kube-ovn-base - name: Load base images - if: env.BUILD_BASE == 1 + if: needs.build-kube-ovn-base.outputs.build-base == 1 run: docker load --input image-amd64.tar - name: Build @@ -120,7 +121,7 @@ jobs: go mod tidy git diff --exit-code make lint - if [ "x${{ env.BUILD_BASE }}" = "x1" ]; then + if [ ${{ needs.build-kube-ovn-base.outputs.build-base }} = 1 ]; then TAG=$(cat VERSION) docker tag kubeovn/kube-ovn-base:$TAG-amd64 kubeovn/kube-ovn-base:$TAG docker tag kubeovn/kube-ovn-base:$TAG-amd64-no-avx512 kubeovn/kube-ovn-base:$TAG-no-avx512 @@ -220,9 +221,8 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: '${{ env.GO_VERSION }}' + go-version-file: ${{ env.E2E_DIR }}/go.mod check-latest: true - id: go - name: Export Go full version run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV" @@ -241,10 +241,9 @@ jobs: run: make e2e-compile - 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 + uses: helm/kind-action@v1 + with: + install_only: true - name: Download image uses: actions/download-artifact@v3 @@ -275,6 +274,7 @@ jobs: k8s-netpol-e2e: name: Kubernetes Network Policy E2E + if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'network policy') needs: build-kube-ovn runs-on: ubuntu-22.04 timeout-minutes: 60 @@ -313,9 +313,8 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: '${{ env.GO_VERSION }}' + go-version-file: ${{ env.E2E_DIR }}/go.mod check-latest: true - id: go - name: Export Go full version run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV" @@ -334,10 +333,9 @@ jobs: run: make e2e-compile - 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 + uses: helm/kind-action@v1 + with: + install_only: true - name: Download image uses: actions/download-artifact@v3 @@ -364,6 +362,7 @@ jobs: k8s-netpol-legacy-e2e: name: Kubernetes Network Policy Legacy E2E + if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'network policy') needs: build-kube-ovn runs-on: ubuntu-22.04 timeout-minutes: 60 @@ -402,9 +401,8 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: '${{ env.GO_VERSION }}' + go-version-file: ${{ env.E2E_DIR }}/go.mod check-latest: true - id: go - name: Export Go full version run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV" @@ -415,7 +413,7 @@ jobs: path: | ~/.cache/go-build ~/go/pkg/mod - key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles('${{ env.E2E_DIR }}/**/go.sum') }} + key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86- - name: Build e2e binaries @@ -423,10 +421,9 @@ jobs: run: make e2e-compile - 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 + uses: helm/kind-action@v1 + with: + install_only: true - name: Download image uses: actions/download-artifact@v3 @@ -453,6 +450,7 @@ jobs: cyclonus-netpol-e2e: name: Cyclonus Network Policy E2E + if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'network policy') needs: build-kube-ovn runs-on: ubuntu-22.04 timeout-minutes: 30 @@ -485,10 +483,9 @@ jobs: fi - 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 + uses: helm/kind-action@v1 + with: + install_only: true - name: Download image uses: actions/download-artifact@v3 @@ -525,9 +522,6 @@ jobs: - ipv4 - ipv6 - dual - mode: - - overlay - - underlay steps: - uses: actions/checkout@v3 @@ -551,9 +545,8 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: '${{ env.GO_VERSION }}' + go-version-file: ${{ env.E2E_DIR }}/go.mod check-latest: true - id: go - name: Export Go full version run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV" @@ -572,10 +565,9 @@ jobs: run: make e2e-compile - 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 + uses: helm/kind-action@v1 + with: + install_only: true - name: Download image uses: actions/download-artifact@v3 @@ -594,14 +586,13 @@ jobs: sudo chown -R $(id -un). ~/.kube/ - name: Install Kube-OVN - run: make kind-install-${{ matrix.mode }}-${{ matrix.ip-family }} + run: make kind-install-${{ matrix.ip-family }} - name: Run E2E working-directory: ${{ env.E2E_DIR }} env: E2E_BRANCH: ${{ github.base_ref || github.ref_name }} E2E_IP_FAMILY: ${{ matrix.ip-family }} - E2E_NETWORK_MODE: ${{ matrix.mode }} run: make kube-ovn-conformance-e2e - name: Cleanup @@ -635,9 +626,8 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: '${{ env.GO_VERSION }}' + go-version-file: ${{ env.E2E_DIR }}/go.mod check-latest: true - id: go - name: Export Go full version run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV" @@ -656,10 +646,9 @@ jobs: run: make e2e-compile - 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 + uses: helm/kind-action@v1 + with: + install_only: true - name: Download image uses: actions/download-artifact@v3 @@ -693,10 +682,9 @@ jobs: - uses: actions/checkout@v3 - 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 + uses: helm/kind-action@v1 + with: + install_only: true - name: Download image uses: actions/download-artifact@v3 @@ -733,10 +721,9 @@ jobs: - uses: actions/checkout@v3 - 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 + uses: helm/kind-action@v1 + with: + install_only: true - name: Download image uses: actions/download-artifact@v3 @@ -769,10 +756,9 @@ jobs: - uses: actions/checkout@v3 - 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 + uses: helm/kind-action@v1 + with: + install_only: true - name: Download image uses: actions/download-artifact@v3 @@ -807,10 +793,9 @@ jobs: - uses: actions/checkout@v3 - 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 + uses: helm/kind-action@v1 + with: + install_only: true - name: Download image uses: actions/download-artifact@v3 @@ -866,9 +851,8 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: '${{ env.GO_VERSION }}' + go-version-file: ${{ env.E2E_DIR }}/go.mod check-latest: true - id: go - name: Export Go full version run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV" @@ -887,10 +871,9 @@ jobs: run: make e2e-compile - 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 + uses: helm/kind-action@v1 + with: + install_only: true - name: Download kube-ovn image uses: actions/download-artifact@v3 @@ -934,10 +917,9 @@ jobs: - uses: actions/checkout@v3 - 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 + uses: helm/kind-action@v1 + with: + install_only: true - name: Download image uses: actions/download-artifact@v3 @@ -997,9 +979,8 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: '${{ env.GO_VERSION }}' + go-version-file: ${{ env.E2E_DIR }}/go.mod check-latest: true - id: go - name: Export Go full version run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV" @@ -1018,10 +999,9 @@ jobs: run: make e2e-compile - 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 + uses: helm/kind-action@v1 + with: + install_only: true - name: Download image uses: actions/download-artifact@v3 @@ -1090,9 +1070,8 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: '${{ env.GO_VERSION }}' + go-version-file: ${{ env.E2E_DIR }}/go.mod check-latest: true - id: go - name: Export Go full version run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV" @@ -1111,10 +1090,9 @@ jobs: run: make e2e-compile - 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 + uses: helm/kind-action@v1 + with: + install_only: true - name: Download image uses: actions/download-artifact@v3 @@ -1165,6 +1143,7 @@ jobs: - no-np-test - cilium-chaining-e2e - kube-ovn-security-e2e + if: always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 @@ -1206,7 +1185,7 @@ jobs: make scan - name: Push - if: ${{ github.ref == 'refs/heads/master' || contains(github.ref, 'release') }} + if: github.ref_name == github.event.repository.default_branch || startsWith(github.ref_name, 'release-') env: DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 29450260e58..42c312db945 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -12,9 +12,6 @@ concurrency: group: "${{ github.workflow }}-${{ github.ref }}" cancel-in-progress: true -env: - GO_VERSION: '1.20' - jobs: golangci: name: lint @@ -23,9 +20,8 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: '${{ env.GO_VERSION }}' + go-version-file: go.mod check-latest: true - id: go - name: golangci-lint uses: golangci/golangci-lint-action@v3 diff --git a/.github/workflows/scheduled-e2e.yaml b/.github/workflows/scheduled-e2e.yaml index c659a64ce82..ea5eb1e03e1 100644 --- a/.github/workflows/scheduled-e2e.yaml +++ b/.github/workflows/scheduled-e2e.yaml @@ -10,8 +10,6 @@ concurrency: cancel-in-progress: true env: - GO_VERSION: '1.20' - KIND_VERSION: v0.17.0 HELM_VERSION: v3.10.1 jobs: @@ -45,9 +43,8 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: '${{ env.GO_VERSION }}' + go-version-file: go.mod check-latest: true - id: go - name: Export Go full version run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV" @@ -72,10 +69,9 @@ jobs: path: test/e2e/k8s-network/branches/${{ matrix.branch }} - 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 + uses: helm/kind-action@v1 + with: + install_only: true - name: Create kind cluster working-directory: test/e2e/k8s-network/branches/${{ matrix.branch }} @@ -127,9 +123,8 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: '${{ env.GO_VERSION }}' + go-version-file: go.mod check-latest: true - id: go - name: Export Go full version run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV" @@ -154,10 +149,9 @@ jobs: path: test/e2e/k8s-network/branches/${{ matrix.branch }} - 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 + uses: helm/kind-action@v1 + with: + install_only: true - name: Create kind cluster working-directory: test/e2e/k8s-network/branches/${{ matrix.branch }} @@ -205,9 +199,8 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: '${{ env.GO_VERSION }}' + go-version-file: go.mod check-latest: true - id: go - name: Export Go full version run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV" @@ -232,10 +225,9 @@ jobs: path: test/e2e/k8s-network/branches/${{ matrix.branch }} - 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 + uses: helm/kind-action@v1 + with: + install_only: true - name: Create kind cluster working-directory: test/e2e/k8s-network/branches/${{ matrix.branch }} @@ -292,10 +284,9 @@ jobs: path: test/e2e/k8s-network/branches/${{ matrix.branch }} - 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 + uses: helm/kind-action@v1 + with: + install_only: true - name: Create kind cluster working-directory: test/e2e/k8s-network/branches/${{ matrix.branch }} @@ -340,9 +331,8 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: '${{ env.GO_VERSION }}' + go-version-file: go.mod check-latest: true - id: go - name: Export Go full version run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV" @@ -367,10 +357,9 @@ jobs: path: test/e2e/kube-ovn/branches/${{ matrix.branch }} - 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 + uses: helm/kind-action@v1 + with: + install_only: true - name: Create kind cluster working-directory: test/e2e/kube-ovn/branches/${{ matrix.branch }} @@ -411,9 +400,8 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: '${{ env.GO_VERSION }}' + go-version-file: go.mod check-latest: true - id: go - name: Export Go full version run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV" @@ -438,10 +426,9 @@ jobs: path: test/e2e/kube-ovn/branches/${{ matrix.branch }} - 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 + uses: helm/kind-action@v1 + with: + install_only: true - name: Create kind cluster working-directory: test/e2e/kube-ovn/branches/${{ matrix.branch }} @@ -487,10 +474,9 @@ jobs: path: test/e2e/kube-ovn/branches/${{ matrix.branch }} - 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 + uses: helm/kind-action@v1 + with: + install_only: true - name: Create kind cluster working-directory: test/e2e/kube-ovn/branches/${{ matrix.branch }} @@ -538,10 +524,9 @@ jobs: path: test/e2e/kube-ovn/branches/${{ matrix.branch }} - 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 + uses: helm/kind-action@v1 + with: + install_only: true - name: Create kind cluster working-directory: test/e2e/kube-ovn/branches/${{ matrix.branch }} @@ -590,10 +575,9 @@ jobs: path: test/e2e/kube-ovn/branches/${{ matrix.branch }} - 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 + uses: helm/kind-action@v1 + with: + install_only: true - name: Create kind cluster working-directory: test/e2e/kube-ovn/branches/${{ matrix.branch }} @@ -644,10 +628,9 @@ jobs: path: test/e2e/kube-ovn/branches/${{ matrix.branch }} - 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 + uses: helm/kind-action@v1 + with: + install_only: true - name: Create kind cluster working-directory: test/e2e/kube-ovn/branches/${{ matrix.branch }} @@ -695,9 +678,8 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: '${{ env.GO_VERSION }}' + go-version-file: go.mod check-latest: true - id: go - name: Export Go full version run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV" @@ -712,10 +694,9 @@ jobs: restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86- - 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 + uses: helm/kind-action@v1 + with: + install_only: true - name: Create kind cluster working-directory: test/e2e/kube-ovn/branches/${{ matrix.branch }} @@ -768,10 +749,9 @@ jobs: path: test/e2e/kube-ovn/branches/${{ matrix.branch }} - 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 + uses: helm/kind-action@v1 + with: + install_only: true - name: Create kind cluster run: | @@ -818,9 +798,8 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: '${{ env.GO_VERSION }}' + go-version-file: go.mod check-latest: true - id: go - name: Export Go full version run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV" @@ -845,10 +824,9 @@ jobs: path: test/e2e/kube-ovn/branches/${{ matrix.branch }} - 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 + uses: helm/kind-action@v1 + with: + install_only: true - name: Create kind cluster working-directory: test/e2e/kube-ovn/branches/${{ matrix.branch }} @@ -899,9 +877,8 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: '${{ env.GO_VERSION }}' + go-version-file: go.mod check-latest: true - id: go - name: Export Go full version run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV" @@ -926,10 +903,9 @@ jobs: path: test/e2e/kube-ovn/branches/${{ matrix.branch }} - 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 + uses: helm/kind-action@v1 + with: + install_only: true - name: Create kind cluster working-directory: test/e2e/kube-ovn/branches/${{ matrix.branch }} @@ -975,9 +951,8 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: '${{ env.GO_VERSION }}' + go-version-file: go.mod check-latest: true - id: go - name: Export Go full version run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV" @@ -1002,10 +977,9 @@ jobs: path: test/e2e/kube-ovn/branches/${{ matrix.branch }} - 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 + uses: helm/kind-action@v1 + with: + install_only: true - name: Create kind cluster working-directory: test/e2e/kube-ovn/branches/${{ matrix.branch }}