Skip to content

Commit

Permalink
Migrate golangci-lint to a github workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Demeester <[email protected]>
  • Loading branch information
vdemeester committed Jan 13, 2025
1 parent d67c9c2 commit 0e7d62c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 15 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: golangci-lint
on: # yamllint disable-line rule:truthy
push:
branches:
- main
pull_request: # yamllint disable-line rule:empty-values

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.62.2
args: --timeout=10m
15 changes: 0 additions & 15 deletions test/presubmit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,6 @@ export DISABLE_YAML_LINTING=1

source $(git rev-parse --show-toplevel)/vendor/github.com/tektoncd/plumbing/scripts/presubmit-tests.sh

function check_go_lint() {
header "Testing if golint has been done"

# deadline of 5m, and show all the issues
GOFLAGS="-mod=mod" make golangci-lint-check

if [[ $? != 0 ]]; then
results_banner "Go Lint" 1
exit 1
fi

results_banner "Go Lint" 0
}

function check_yaml_lint() {
header "Testing if yamllint has been done"

Expand Down Expand Up @@ -77,7 +63,6 @@ EOF
}

function post_build_tests() {
check_go_lint
check_yaml_lint
ko_resolve
}
Expand Down

0 comments on commit 0e7d62c

Please sign in to comment.