From a870b483982b8e136ff8f4aebe6bd3f64f983353 Mon Sep 17 00:00:00 2001 From: Shahzad Lone Date: Tue, 5 Apr 2022 16:37:03 -0400 Subject: [PATCH] ci: Update golang-ci linter and explicit go-setup to use v1.17 (#331) * Bump to latest golangci version. * Bump `checkout`, `go-setup`, `golangci` and `golangci-action` * Setup go environment right before the linter is ran. * Bump other `checkout`(s) and also omit the patch version in `y.x.0` and set `check-latest: true`. --- .github/workflows/code-test-coverage.yml | 7 ++++--- .github/workflows/lint-then-benchmark.yml | 19 +++++++++++++------ Makefile | 2 +- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/code-test-coverage.yml b/.github/workflows/code-test-coverage.yml index 8830f99561..5418d74b8f 100644 --- a/.github/workflows/code-test-coverage.yml +++ b/.github/workflows/code-test-coverage.yml @@ -8,14 +8,15 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 2 - name: Setup Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: - go-version: '1.17.5' + go-version: '1.17' + check-latest: true - name: Generate full test coverage report using go-acc run: make test:coverage-full diff --git a/.github/workflows/lint-then-benchmark.yml b/.github/workflows/lint-then-benchmark.yml index 0ecc9fb26d..85fd8d99b5 100644 --- a/.github/workflows/lint-then-benchmark.yml +++ b/.github/workflows/lint-then-benchmark.yml @@ -37,17 +37,24 @@ jobs: runs-on: ${{ matrix.os }} steps: - - name: Check out code into the directory - uses: actions/checkout@v2 + - name: Checkout code into the directory + uses: actions/checkout@v3 + + # Setting up Go explicitly is required for v3.0.0+ of golangci/golangci-lint-action. + - name: Setup Go environment explicitly + uses: actions/setup-go@v3 + with: + go-version: '1.17' + check-latest: true - name: Run the golangci-lint - uses: golangci/golangci-lint-action@v2 + uses: golangci/golangci-lint-action@v3 with: # Required: the version of golangci-lint is required. # Note: The version should not pick the patch version as the latest patch # version is what will always be used. - version: v1.44 + version: latest # Optional: working directory, useful for monorepos or if we wanted to run this # on a non-root directory. @@ -74,7 +81,7 @@ jobs: # =================== Step-2: Decide what type of benchmarks to run based on label(s). # This job acts like a switch to simplify our ci control flow later on. decide-benchmark-type: - name: Deciding which benchmarks to run based on flags + name: Decide which benchmarks to run based on flags strategy: matrix: os: [ubuntu-latest] @@ -173,7 +180,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Run the full bechmarking suite if: needs.decide-benchmark-type.outputs.benchmark-type == 'FULL' diff --git a/Makefile b/Makefile index 839ebad776..1574929c98 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ dump: build .PHONY: deps\:lint deps\:lint: - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ${GOPATH}/bin v1.44.0 + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ${GOPATH}/bin latest .PHONY: deps\:go-acc deps\:go-acc: