Skip to content

Commit

Permalink
ci: use golangci-lint-action v3, GO_VERSION
Browse files Browse the repository at this point in the history
golangci-lint-action v3 no longer installs golang itself, and the
version that comes with Ubuntu is not new/good enough.

Install go 1.17.x explicitly.

Introduce GO_VERSION environment variable to avoid duplication,
and use it instead of 1.x in other places, so that implicit go update
won't bring some unexpected failures.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
  • Loading branch information
kolyshkin committed Mar 7, 2022
1 parent f7d4613 commit f7637de
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/validate.yml
Expand Up @@ -7,18 +7,23 @@ on:
- master
- release-*
pull_request:
env:
GO_VERSION: 1.17.x

jobs:

lint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v2
with:
go-version: "${{ env.GO_VERSION }}"
- name: install deps
run: |
sudo apt -q update
sudo apt -q install libseccomp-dev
- uses: golangci/golangci-lint-action@v2
- uses: golangci/golangci-lint-action@v3
with:
version: v1.44

Expand All @@ -30,11 +35,14 @@ jobs:
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v2
with:
go-version: "${{ env.GO_VERSION }}"
- name: install deps
run: |
sudo apt -q update
sudo apt -q install libseccomp-dev
- uses: golangci/golangci-lint-action@v2
- uses: golangci/golangci-lint-action@v3
with:
only-new-issues: true
args: --config .golangci-extra.yml
Expand All @@ -51,7 +59,7 @@ jobs:
- name: install go
uses: actions/setup-go@v2
with:
go-version: 1.x # Latest stable
go-version: "${{ env.GO_VERSION }}"
- name: compile with no build tags
run: make BUILDTAGS=""

Expand Down Expand Up @@ -118,7 +126,7 @@ jobs:
- name: install go
uses: actions/setup-go@v2
with:
go-version: 1.x # Latest stable
go-version: "${{ env.GO_VERSION }}"
- name: cache go mod and $GOCACHE
uses: actions/cache@v2
with:
Expand Down

0 comments on commit f7637de

Please sign in to comment.