-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (35 loc) · 944 Bytes
/
Copy pathgolangci-lint.yml
File metadata and controls
36 lines (35 loc) · 944 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: golangci-lint
on:
push:
branches:
- main
pull_request:
jobs:
generate-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v7
- id: set-matrix
run: |
DIRECTORIES=$(find . -type d -not -path '*/\.*' | jq -R -s -c 'split("\n")[:-1]')
echo "matrix=${DIRECTORIES}" >> $GITHUB_OUTPUT
golangci:
name: Lint
needs: generate-matrix
runs-on: ubuntu-latest
strategy:
matrix:
modules: ${{fromJson(needs.generate-matrix.outputs.matrix)}}
steps:
- uses: actions/setup-go@v6
with:
go-version: "stable"
check-latest: true
cache-dependency-path: "**/go.sum"
- uses: actions/checkout@v7
- uses: golangci/golangci-lint-action@v9.2.1
with:
version: latest
working-directory: ${{ matrix.modules }}