Skip to content

Commit 8b9084a

Browse files
committed
Add CI actions.
1 parent 40a2d72 commit 8b9084a

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Go
16+
uses: actions/setup-go@v5
17+
with:
18+
go-version: '1.24'
19+
20+
- name: Verify formatting
21+
run: |
22+
if [ "$(gofmt -l . | wc -l)" -gt 0 ]; then
23+
echo "Please run gofmt"
24+
gofmt -l .
25+
exit 1
26+
fi
27+
28+
- name: Verify go mod
29+
run: |
30+
go mod verify
31+
go mod tidy
32+
git diff --exit-code go.mod go.sum
33+
34+
- name: Run go vet
35+
run: go vet ./...
36+
37+
- name: Run tests
38+
run: go test -v -race ./...
39+
40+
- name: Build
41+
run: go build .

0 commit comments

Comments
 (0)