Skip to content

Commit 301c715

Browse files
committed
init ci
1 parent 25d47fd commit 301c715

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Go Build, Test, and Format
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build-test-format:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Go
18+
uses: actions/setup-go@v5
19+
with:
20+
go-version: '1.24.4'
21+
22+
- name: Build
23+
run: go build ./...
24+
25+
- name: Run Tests
26+
run: go test ./...
27+
28+
- name: Check gofmt
29+
run: |
30+
UNFORMATTED=$(gofmt -l .)
31+
if [ -n "$UNFORMATTED" ]; then
32+
echo "The following files need to be formatted:"
33+
echo "$UNFORMATTED"
34+
exit 1
35+
fi

0 commit comments

Comments
 (0)