Skip to content

Commit a38c2b7

Browse files
authored
Add static analysis stage to workflow (#29)
Use golangci-lint as the tool for the job. See https://golangci-lint.run for more details on the tool. Extra: restructure workflow code to be more consistent in sytle.
1 parent 674ad88 commit a38c2b7

File tree

2 files changed

+36
-11
lines changed

2 files changed

+36
-11
lines changed

.github/workflows/check.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: check
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
pull_request:
9+
10+
jobs:
11+
golangci-lint:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/setup-go@v5
15+
- uses: actions/checkout@v4
16+
- uses: golangci/golangci-lint-action@v6
17+
with:
18+
version: v1.58

.github/workflows/test.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
1-
on: [push, pull_request]
2-
name: Test
1+
name: test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
pull_request:
9+
310
jobs:
4-
test:
11+
go-test:
512
strategy:
613
matrix:
714
go-version: [1.16.x, 1.19.x]
815
os: [ubuntu-latest]
916
runs-on: ${{ matrix.os }}
1017
steps:
11-
- name: Install Go
12-
uses: actions/setup-go@v5
13-
with:
14-
go-version: ${{ matrix.go-version }}
15-
- name: Checkout code
16-
uses: actions/checkout@v4
17-
- name: Test
18-
run: go test -v -cover ./...
18+
- name: Install Go
19+
uses: actions/setup-go@v5
20+
with:
21+
go-version: ${{ matrix.go-version }}
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
- name: Test
25+
run: go test -v -cover ./...

0 commit comments

Comments
 (0)