ci: speed up lint job (backport #17071) (#17076)

Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
mergify[bot]
2023-07-20 18:58:54 +02:00
committed by GitHub
co-authored by Julien Robert
parent 75501a16e1
commit ab140e5a56
5 changed files with 54 additions and 11 deletions
+1
View File
@@ -31,6 +31,7 @@ I have...
* [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
* [ ] updated the relevant documentation or specification
* [ ] reviewed "Files changed" and left comments if necessary
* [ ] run `make lint` and `make test`
* [ ] confirmed all CI checks have passed
### Reviewers Checklist
+18 -2
View File
@@ -20,6 +20,19 @@ jobs:
check-latest: true
- uses: technote-space/get-diff-action@v6.1.2
id: git_diff
with:
PATTERNS: |
Makefile
**/Makefile
.golangci.yml
- name: run linting (long)
if: env.GIT_DIFF
id: lint_long
run: |
make lint
- uses: technote-space/get-diff-action@v6.1.2
if: steps.lint_long.outcome == 'skipped'
id: git_diff_all
with:
PATTERNS: |
**/*.go
@@ -27,7 +40,10 @@ jobs:
go.sum
**/go.mod
**/go.sum
- name: run linting
if: env.GIT_DIFF
- name: run linting (short)
if: steps.lint_long.outcome == 'skipped' && env.GIT_DIFF
run: |
make lint
env:
GIT_DIFF: ${{ env.GIT_DIFF }}
LINT_DIFF: 1