File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121 steps :
2222 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2323 with :
24- fetch-depth : 1
24+ fetch-depth : 0
2525
2626 - name : " Mount tmpfs"
2727 shell : bash
8989 restore-keys : |
9090 ${{ runner.os }}-golangci-lint-
9191
92+ - name : Fetch main branch
93+ if : github.ref != 'refs/heads/main'
94+ run : git fetch origin main --depth=1
95+
9296 - name : Lint
93- run : make run-lint
97+ run : |
98+ if [ "${{ github.ref }}" = "refs/heads/main" ]; then
99+ make run-lint
100+ else
101+ make run-lint-incremental
102+ fi
Original file line number Diff line number Diff line change @@ -39,6 +39,10 @@ run-lint:
3939 @echo " Linting with feature flags: [$( LINT_TAGS) ]"
4040 GOFLAGS=" -tags=$( LINT_TAGS) " golangci-lint run -v --timeout=30m ./...
4141
42+ run-lint-incremental :
43+ @echo " Incremental lint vs origin/main with feature flags: [$( LINT_TAGS) ]"
44+ GOFLAGS=" -tags=$( LINT_TAGS) " golangci-lint run -v --timeout=10m --new-from-rev origin/main ./...
45+
4246run-lint-fix :
4347 @echo " Linting with feature flags: [$( LINT_TAGS) ]"
4448 GOFLAGS=" -tags=$( LINT_TAGS) " golangci-lint run -v --timeout=30m --fix ./...
6064 done ; \
6165 done
6266
63- .PHONY : help fmt fmtcheck install-pre-commit-hook clean run-lint run-lint-fix fuzz
67+ .PHONY : help fmt fmtcheck install-pre-commit-hook clean run-lint run-lint-incremental run-lint- fix fuzz
You can’t perform that action at this time.
0 commit comments