Skip to content

Commit 5d37015

Browse files
committed
use separate workflow for linters
1 parent bc3cace commit 5d37015

File tree

3 files changed

+39
-4
lines changed

3 files changed

+39
-4
lines changed

.github/workflows/pr.yml .github/workflows/ggshield.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: GitGuardian scan
22

3-
on: [push, pull_request]
3+
on:
4+
workflow_dispatch:
5+
push:
46

57
jobs:
68
scanning:
@@ -16,6 +18,6 @@ jobs:
1618
env:
1719
GITHUB_PUSH_BEFORE_SHA: ${{ github.event.before }}
1820
GITHUB_PUSH_BASE_SHA: ${{ github.event.base }}
19-
GITHUB_PULL_BASE_SHA: ${{ github.event.pull_request.base.sha }}
21+
GITHUB_PULL_BASE_SHA: ${{ github.event.pull_request.base.sha }}
2022
GITHUB_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
2123
GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }}

.github/workflows/linters.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Linters, static checks and code coverage
2+
3+
on:
4+
workflow_dispatch:
5+
# push:
6+
# branches: [main, dk-add-linters]
7+
# paths-ignore:
8+
# - "docs/**"
9+
# - "**.md"
10+
# pull_request:
11+
# paths-ignore:
12+
# - "docs/**"
13+
# - "**.md"
14+
15+
jobs:
16+
run-linters:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
# - name: Run static check
21+
# uses: dominikh/[email protected]
22+
# - name: Run static check
23+
# uses: reviewdog/action-staticcheck@v1
24+
# with:
25+
# # TODO: pick filter https://github.com/reviewdog/reviewdog#filter-mode
26+
# filter_mode: nofilter

.github/workflows/main.yml

+9-2
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,19 @@ jobs:
6262
# Only run if the test failed on target version to avoid duplicated annotations on GitHub.
6363
if: ${{ always() && env.TARGET_GOLANG_VERSION == matrix.go }}
6464
uses: reviewdog/action-staticcheck@v1
65+
with:
66+
# TODO: pick filter https://github.com/reviewdog/reviewdog#filter-mode
67+
filter_mode: nofilter
68+
- name: Run golangci-lint
69+
# Only run if the test failed on target version to avoid duplicated annotations on GitHub.
70+
if: ${{ always() && env.TARGET_GOLANG_VERSION == matrix.go }}
71+
uses: golangci/golangci-lint-action@v3
6572
# TODO(@okdas): move coverage to a separate job
6673
- name: create coverage report
67-
if: ${{ env.TARGET_GOLANG_VERSION == matrix.go }}
74+
if: ${{ always() && env.TARGET_GOLANG_VERSION == matrix.go }}
6875
run: make test_all_with_coverage
6976
- name: Upload coverage to Codecov
70-
if: ${{ env.TARGET_GOLANG_VERSION == matrix.go }}
77+
if: ${{ always() && env.TARGET_GOLANG_VERSION == matrix.go }}
7178
uses: codecov/codecov-action@v3
7279

7380
# TODO(@okdas): reuse artifacts built by the previous job instead

0 commit comments

Comments
 (0)