Skip to content

Commit 4377342

Browse files
(ci): Improve GitHub Action to linter simples
This commit change the action in order to use a matrix to validate all samples under testdata
1 parent 1024dc4 commit 4377342

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

.github/workflows/lint-sample.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ on:
1111
jobs:
1212
lint-samples:
1313
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
folder: [
17+
"testdata/project-v4",
18+
"testdata/project-v4-with-plugins",
19+
"testdata/project-v4-multigroup"
20+
]
1421
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository)
1522
steps:
1623
- name: Clone the code
@@ -19,15 +26,16 @@ jobs:
1926
uses: actions/setup-go@v5
2027
with:
2128
go-version-file: go.mod
29+
- name: Prepare ${{ matrix.folder }}
30+
working-directory: ${{ matrix.folder }}
31+
run: go mod tidy
2232
- name: Run linter
2333
uses: golangci/golangci-lint-action@v6
2434
with:
2535
version: v1.59
26-
working-directory: testdata/project-v4
27-
args: --config .golangci.yml ./...
28-
- name: Run linter
29-
uses: golangci/golangci-lint-action@v6
30-
with:
31-
version: v1.59
32-
working-directory: testdata/project-v4-with-plugins
36+
working-directory: ${{ matrix.folder }}
3337
args: --config .golangci.yml ./...
38+
- name: Run linter via makefile target
39+
working-directory: ${{ matrix.folder }}
40+
run: make lint
41+

0 commit comments

Comments
 (0)