Skip to content

Commit

Permalink
Migrate to GitHubAction for GolangCI Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
khrm committed Jan 15, 2025
1 parent ed85c09 commit 81cb68a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 16 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
16 changes: 0 additions & 16 deletions test/presubmit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,6 @@ export GO111MODULE=on

source $(dirname $0)/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 pre_build_tests() {
pushd ${TEST_FOLDER}
}
Expand All @@ -58,7 +43,6 @@ function pre_integration_tests() {

function post_build_tests() {
popd
check_go_lint
}

function post_unit_tests() {
Expand Down

0 comments on commit 81cb68a

Please sign in to comment.