Skip to content

Commit

Permalink
ci: Update golang-ci linter and explicit go-setup to use v1.17 (sourc…
Browse files Browse the repository at this point in the history
…enetwork#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`.
  • Loading branch information
shahzadlone committed Apr 5, 2022
1 parent 497547e commit a870b48
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/code-test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 13 additions & 6 deletions .github/workflows/lint-then-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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]
Expand Down Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit a870b48

Please sign in to comment.