Skip to content

Commit

Permalink
build: Make make lint faster (argoproj#1774)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Collins <[email protected]>
  • Loading branch information
alexec authored Mar 28, 2022
1 parent eb02b14 commit ef59f07
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,12 @@ jobs:
golangci:
name: lint
runs-on: ubuntu-latest
timeout-minutes: 10
env:
GOPATH: /home/runner/go
steps:
- uses: actions/checkout@v3
- name: Setup Golang
uses: actions/[email protected]
with:
go-version: "1.17.1"
- name: Add to PATH
run: |
echo /home/runner/go/bin >> $GITHUB_PATH
- name: golangci-lint
run: |
echo 'GOPATH=/home/runner/go' >> $GITHUB_ENV
make lint
fetch-depth: 0
- uses: golangci/golangci-lint-action@v2
- run: git diff --exit-code
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ linters:
- unused
- varcheck
- whitespace

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,12 @@ start: image
kubectl -n argo-events wait --for=condition=Ready --timeout 60s pod --all

$(GOPATH)/bin/golangci-lint:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b `go env GOPATH`/bin v1.44.0
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b `go env GOPATH`/bin

.PHONY: lint
lint: $(GOPATH)/bin/golangci-lint
go mod tidy
golangci-lint run --fix --verbose --concurrency 4 --timeout 5m
golangci-lint run --fix --verbose

# release - targets only available on release branch
ifneq ($(findstring release,$(GIT_BRANCH)),)
Expand Down

0 comments on commit ef59f07

Please sign in to comment.