Skip to content

Commit

Permalink
Use go.mod for setup-go; update golangci-lint (chainguard-dev#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Gibler authored May 5, 2024
1 parent 34390f0 commit 07e2151
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/go-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ jobs:
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4

- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: '1.21'
go-version-file: go.mod
check-latest: true

- name: Checkout code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4

- uses: chainguard-dev/actions/goimports@main

- name: install libyara-dev
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: '1.21'
go-version-file: go.mod
check-latest: true

- uses: chainguard-dev/actions/gofmt@main
Expand All @@ -40,7 +40,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: '1.21'
go-version-file: go.mod
check-latest: true

- uses: chainguard-dev/actions/goimports@main
Expand All @@ -55,7 +55,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: '1.21'
go-version-file: go.mod
check-latest: true

- name: install libyara-dev
Expand All @@ -70,7 +70,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@82d40c283aeb1f2b6595839195e95c2d6a49081b # v3.7.1
with:
version: v1.57
version: v1.58
args: --timeout=5m

lint:
Expand All @@ -84,7 +84,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: '1.21'
go-version-file: go.mod
check-latest: true

- uses: reviewdog/action-misspell@5bd7be2fc7ae56a517184f5c4bbcf2fd7afe3927 # v1.17.0
Expand Down
7 changes: 1 addition & 6 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
run:
# The default runtime timeout is 1m, which doesn't work well on Github Actions.
timeout: 10m
go: "1.22"

# NOTE: This file is populated by the lint-install tool. Local adjustments may be overwritten.
linters-settings:
Expand Down Expand Up @@ -91,12 +92,6 @@ linters-settings:
- name: unconditional-recursion
- name: waitgroup-by-value

staticcheck:
go: "1.18"

unused:
go: "1.18"

output:
sort-results: true

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ LINTERS :=
FIXERS :=

GOLANGCI_LINT_CONFIG := $(LINT_ROOT)/.golangci.yml
GOLANGCI_LINT_VERSION ?= v1.56.2
GOLANGCI_LINT_VERSION ?= v1.58.0
GOLANGCI_LINT_BIN := $(LINT_ROOT)/out/linters/golangci-lint-$(GOLANGCI_LINT_VERSION)-$(LINT_ARCH)
$(GOLANGCI_LINT_BIN):
mkdir -p $(LINT_ROOT)/out/linters
Expand Down

0 comments on commit 07e2151

Please sign in to comment.