Skip to content

Commit 26b33bf

Browse files
authored
Merge pull request #4 from metalfm/test-on-push
Test on push
2 parents f88dacc + 4dc94d6 commit 26b33bf

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

.github/workflows/test.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Run tests
2+
on:
3+
push:
4+
branches: ['*']
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
test:
11+
strategy:
12+
matrix:
13+
go-version: [1.22.x, 1.23.x]
14+
os: [ubuntu-latest]
15+
runs-on: ${{ matrix.os }}
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-go@v5
19+
with:
20+
go-version: ${{ matrix.go-version }}
21+
- run: make test
22+
gen:
23+
strategy:
24+
matrix:
25+
go-version: [ 1.22.x, 1.23.x ]
26+
os: [ ubuntu-latest ]
27+
runs-on: ${{ matrix.os }}
28+
steps:
29+
- uses: actions/checkout@v4
30+
- uses: actions/setup-go@v5
31+
with:
32+
go-version: ${{ matrix.go-version }}
33+
- run: make gen
34+
- name: if any modified files exists
35+
run: |
36+
if [ `git status --porcelain | wc -l` -gt 0 ]; then
37+
git --no-pager diff
38+
git --no-pager status -s
39+
exit 1
40+
fi
41+
lint:
42+
strategy:
43+
matrix:
44+
go-version: [ 1.22.x, 1.23.x ]
45+
os: [ ubuntu-latest ]
46+
runs-on: ${{ matrix.os }}
47+
steps:
48+
- uses: actions/checkout@v4
49+
- uses: actions/setup-go@v5
50+
with:
51+
go-version: ${{ matrix.go-version }}
52+
- run: make lint

0 commit comments

Comments
 (0)