Skip to content

Commit

Permalink
Switch to golangci-lint GH action
Browse files Browse the repository at this point in the history
Start using the golangci-lint github action and stop using
the check as part of the build jobs.

This way the version of the actions can be maintained by
dependabot, the version of golangci-lint can be updated in
the YAML and code in PRs can be annotated with issues.
It also reduces the load in the prow job slighlty, saving
a little infra cost.

Signed-off-by: Andrea Frittoli <[email protected]>
  • Loading branch information
afrittoli committed Jan 10, 2025
1 parent aea48e1 commit bd4125a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
24 changes: 24 additions & 0 deletions .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: golangci-lint
on:
push:
branches:
- main
pull_request:

permissions:
contents: read
checks: write # Used to annotate code in the PR

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version: stable
- name: golangci-lint
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
with:
version: v1.60
3 changes: 2 additions & 1 deletion test/presubmit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ function check_yaml_lint() {
}

function post_build_tests() {
check_go_lint
# golangci-lint is executed now via GitHub actions
# check_go_lint
check_yaml_lint
}

Expand Down

0 comments on commit bd4125a

Please sign in to comment.