Skip to content

Commit 4e894ab

Browse files
committed
update linting workflow
1 parent 6c9ac31 commit 4e894ab

File tree

1 file changed

+19
-43
lines changed

1 file changed

+19
-43
lines changed

.github/workflows/lint.yml

Lines changed: 19 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,26 @@
1-
name: Lint and Format
2-
1+
name: golangci-lint
32
on:
43
push:
5-
branches: [ main, develop ]
4+
branches:
5+
- main
6+
- master
67
pull_request:
7-
branches: [ main ]
8+
9+
permissions:
10+
contents: read
11+
# Optional: allow read access to pull requests. Use with `only-new-issues` option.
12+
# pull-requests: read
813

914
jobs:
10-
lint:
11-
name: Lint and Format
15+
golangci:
16+
name: lint
1217
runs-on: ubuntu-latest
13-
1418
steps:
15-
- name: Check out code
16-
uses: actions/checkout@v4
17-
18-
- name: Set up Go
19-
uses: actions/setup-go@v5
20-
with:
21-
go-version: '1.24'
22-
23-
- name: Cache Go modules
24-
uses: actions/cache@v4
25-
with:
26-
path: ~/go/pkg/mod
27-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
28-
restore-keys: |
29-
${{ runner.os }}-go-
30-
31-
- name: Install dependencies
32-
run: make deps
33-
34-
- name: Run format check
35-
run: |
36-
make fmt
37-
if [ -n "$(git status --porcelain)" ]; then
38-
echo "Code is not properly formatted. Run 'make fmt' and commit the changes."
39-
git diff
40-
exit 1
41-
fi
42-
43-
- name: Run vet
44-
run: make vet
45-
46-
- name: Run staticcheck
47-
uses: dominikh/[email protected]
48-
with:
49-
version: "2023.1.7"
50-
install-go: false
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-go@v5
21+
with:
22+
go-version: stable
23+
- name: golangci-lint
24+
uses: golangci/golangci-lint-action@v8
25+
with:
26+
version: v2.1

0 commit comments

Comments
 (0)