diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml new file mode 100644 index 00000000000..dfb8cd47593 --- /dev/null +++ b/.github/workflows/golangci-lint.yaml @@ -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.60 + args: --timeout=10m diff --git a/test/presubmit-tests.sh b/test/presubmit-tests.sh index 9369dd57cb3..ba72739e3db 100755 --- a/test/presubmit-tests.sh +++ b/test/presubmit-tests.sh @@ -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" @@ -77,7 +63,6 @@ EOF } function post_build_tests() { - check_go_lint check_yaml_lint ko_resolve }