From 99004504777cfe8d8615d5693f1fa87867329f30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Mon, 16 Oct 2023 11:20:21 +0200 Subject: [PATCH] [chore] Use check-latest in actions/setup-go (#4617) --- .github/workflows/benchmark.yml | 4 +++- .github/workflows/ci.yml | 27 ++++++---------------- .github/workflows/create-dependabot-pr.yml | 4 +++- .github/workflows/dependabot.yml | 4 +++- 4 files changed, 16 insertions(+), 23 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index ba3fffd9d8d..927a0ae123e 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -6,7 +6,7 @@ on: workflow_dispatch: env: - DEFAULT_GO_VERSION: "~1.21.3" + DEFAULT_GO_VERSION: "1.21" jobs: benchmark: name: Benchmarks @@ -17,6 +17,8 @@ jobs: - uses: actions/setup-go@v4 with: go-version: ${{ env.DEFAULT_GO_VERSION }} + check-latest: true + cache-dependency-path: "**/go.sum" - name: Run benchmarks run: make benchmark | tee output.txt - name: Download previous benchmark data diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76c650b7ebd..b74158d4be0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,28 +14,25 @@ env: # backwards compatibility with the previous two minor releases and we # explicitly test our code for these versions so keeping this at prior # versions does not add value. - DEFAULT_GO_VERSION: "~1.21.3" + DEFAULT_GO_VERSION: "1.21" jobs: lint: runs-on: ubuntu-latest steps: - name: Checkout Repo uses: actions/checkout@v4 - - name: Setup Environment - run: | - echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV - echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - name: Install Go uses: actions/setup-go@v4 with: go-version: ${{ env.DEFAULT_GO_VERSION }} + check-latest: true cache-dependency-path: "**/go.sum" - name: Tools cache uses: actions/cache@v3 env: cache-name: go-tools-cache with: - path: ~/.tools + path: .tools key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('./internal/tools/**') }} - name: Generate run: make generate @@ -67,14 +64,11 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v4 - - name: Setup Environment - run: | - echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV - echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - name: Install Go uses: actions/setup-go@v4 with: go-version: ${{ env.DEFAULT_GO_VERSION }} + check-latest: true cache-dependency-path: "**/go.sum" - name: Run tests with race detector run: make test-race @@ -84,14 +78,11 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v4 - - name: Setup Environment - run: | - echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV - echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - name: Install Go uses: actions/setup-go@v4 with: go-version: ${{ env.DEFAULT_GO_VERSION }} + check-latest: true cache-dependency-path: "**/go.sum" - name: Run coverage tests run: | @@ -115,7 +106,7 @@ jobs: compatibility-test: strategy: matrix: - go-version: ["~1.21.3", "~1.20.10"] + go-version: ["1.21", "1.20"] os: [ubuntu-latest, macos-latest, windows-latest] # GitHub Actions does not support arm* architectures on default # runners. It is possible to accomplish this with a self-hosted runner @@ -130,15 +121,11 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - - name: Setup Environment - run: | - echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV - echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - shell: bash - name: Install Go uses: actions/setup-go@v4 with: go-version: ${{ matrix.go-version }} + check-latest: true cache-dependency-path: "**/go.sum" - name: Run tests env: diff --git a/.github/workflows/create-dependabot-pr.yml b/.github/workflows/create-dependabot-pr.yml index 848a92400b4..12af146fa52 100644 --- a/.github/workflows/create-dependabot-pr.yml +++ b/.github/workflows/create-dependabot-pr.yml @@ -10,7 +10,9 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: "~1.21.3" + go-version: "1.21" + check-latest: true + cache-dependency-path: "**/go.sum" - uses: actions/checkout@v4 diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml index 6e714196fc7..d5a92565362 100644 --- a/.github/workflows/dependabot.yml +++ b/.github/workflows/dependabot.yml @@ -13,7 +13,9 @@ jobs: ref: ${{ github.head_ref }} - uses: actions/setup-go@v4 with: - go-version: '~1.21.3' + go-version: "1.21" + check-latest: true + cache-dependency-path: "**/go.sum" - uses: evantorrie/mott-the-tidier@v1-beta id: modtidy with: