From e4aae434dee7e0b8142e0ae6e934a02d78604250 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=A5=96=E5=BB=BA?= Date: Thu, 13 Jul 2023 13:26:49 +0800 Subject: [PATCH] ci: pin go version to 1.20.5 (#3034) --- .github/workflows/build-arm64-image.yaml | 7 ++++- .github/workflows/build-windows.yaml | 9 ++++-- .github/workflows/build-x86-image.yaml | 37 ++++++++++++++++++------ .github/workflows/codeql-analysis.yml | 11 ++++++- .github/workflows/lint.yaml | 7 ++++- 5 files changed, 57 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-arm64-image.yaml b/.github/workflows/build-arm64-image.yaml index 6d3e44d3ef5..1b6f495cd97 100644 --- a/.github/workflows/build-arm64-image.yaml +++ b/.github/workflows/build-arm64-image.yaml @@ -19,16 +19,21 @@ concurrency: group: "${{ github.workflow }}-${{ github.ref }}" cancel-in-progress: true +env: + GO_VERSION: '1.20.5' + jobs: build: name: Build arm64 runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v4 with: + go-version: ${{ env.GO_VERSION || '' }} go-version-file: go.mod check-latest: true + cache: false - name: Set up QEMU uses: docker/setup-qemu-action@v2 diff --git a/.github/workflows/build-windows.yaml b/.github/workflows/build-windows.yaml index 06346a17a23..4335bed58f6 100644 --- a/.github/workflows/build-windows.yaml +++ b/.github/workflows/build-windows.yaml @@ -23,6 +23,7 @@ concurrency: cancel-in-progress: true env: + GO_VERSION: '1.20.5' GOSEC_VERSION: '2.15.0' jobs: @@ -34,10 +35,12 @@ jobs: build-kube-ovn: ${{ steps.filter.outputs.windows-kube-ovn }} steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v4 with: + go-version: ${{ env.GO_VERSION || '' }} go-version-file: go.mod check-latest: true + cache: false - name: Generate path filter env: @@ -178,10 +181,12 @@ jobs: if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' || needs.filter.outputs.build-kube-ovn == 'true' steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v4 with: + go-version: ${{ env.GO_VERSION || '' }} go-version-file: go.mod check-latest: true + cache: false - name: Export Go full version run: | diff --git a/.github/workflows/build-x86-image.yaml b/.github/workflows/build-x86-image.yaml index ec3b98eb3ff..f801ac4b9ef 100644 --- a/.github/workflows/build-x86-image.yaml +++ b/.github/workflows/build-x86-image.yaml @@ -21,6 +21,7 @@ concurrency: cancel-in-progress: true env: + GO_VERSION: '1.20.5' GOSEC_VERSION: '2.15.0' HELM_VERSION: v3.11.1 @@ -72,10 +73,12 @@ jobs: steps: - uses: actions/checkout@v3 - uses: docker/setup-buildx-action@v2 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v4 with: + go-version: ${{ env.GO_VERSION || '' }} go-version-file: go.mod check-latest: true + cache: false - name: Export Go full version run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV" @@ -204,10 +207,12 @@ jobs: echo "E2E_DIR=test/e2e/source" >> "$GITHUB_ENV" fi - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v4 with: + go-version: ${{ env.GO_VERSION || '' }} go-version-file: ${{ env.E2E_DIR }}/go.mod check-latest: true + cache: false - name: Export Go full version run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV" @@ -236,10 +241,12 @@ jobs: test-netpol: ${{ steps.filter.outputs.kube-ovn-controller }} steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v4 with: + go-version: ${{ env.GO_VERSION || '' }} go-version-file: go.mod check-latest: true + cache: false - name: Generate path filter run: | @@ -306,10 +313,12 @@ jobs: sudo sed -i '/^search/d' /etc/resolv.conf sudo systemctl restart docker - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v4 with: + go-version: ${{ env.GO_VERSION || '' }} go-version-file: ${{ env.E2E_DIR }}/go.mod check-latest: true + cache: false - name: Export Go full version run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV" @@ -405,10 +414,12 @@ jobs: sudo sed -i '/^search/d' /etc/resolv.conf sudo systemctl restart docker - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v4 with: + go-version: ${{ env.GO_VERSION || '' }} go-version-file: ${{ env.E2E_DIR }}/go.mod check-latest: true + cache: false - name: Export Go full version run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV" @@ -566,10 +577,12 @@ jobs: echo "E2E_DIR=test/e2e/source" >> "$GITHUB_ENV" fi - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v4 with: + go-version: ${{ env.GO_VERSION || '' }} go-version-file: ${{ env.E2E_DIR }}/go.mod check-latest: true + cache: false - name: Export Go full version run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV" @@ -655,10 +668,12 @@ jobs: echo "E2E_DIR=test/e2e/source" >> "$GITHUB_ENV" fi - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v4 with: + go-version: ${{ env.GO_VERSION || '' }} go-version-file: ${{ env.E2E_DIR }}/go.mod check-latest: true + cache: false - name: Export Go full version run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV" @@ -921,10 +936,12 @@ jobs: sudo sed -i '/^search/d' /etc/resolv.conf sudo systemctl restart docker - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v4 with: + go-version: ${{ env.GO_VERSION || '' }} go-version-file: ${{ env.E2E_DIR }}/go.mod check-latest: true + cache: false - name: Export Go full version run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV" @@ -1018,10 +1035,12 @@ jobs: echo "E2E_DIR=test/e2e/source" >> "$GITHUB_ENV" fi - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v4 with: + go-version: ${{ env.GO_VERSION || '' }} go-version-file: ${{ env.E2E_DIR }}/go.mod check-latest: true + cache: false - name: Export Go full version run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV" diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index a787075d045..fbc5fb800e8 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -14,6 +14,13 @@ on: schedule: - cron: '0 17 * * 2' +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true + +env: + GO_VERSION: '' + jobs: analyze: name: Analyze @@ -36,10 +43,12 @@ jobs: # a pull request then we can checkout the head. fetch-depth: 2 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v4 with: + go-version: ${{ env.GO_VERSION || '' }} go-version-file: go.mod check-latest: true + cache: false # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 42c312db945..69e014c8307 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -12,16 +12,21 @@ concurrency: group: "${{ github.workflow }}-${{ github.ref }}" cancel-in-progress: true +env: + GO_VERSION: '' + jobs: golangci: name: lint runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v4 with: + go-version: ${{ env.GO_VERSION || '' }} go-version-file: go.mod check-latest: true + cache: false - name: golangci-lint uses: golangci/golangci-lint-action@v3