Skip to content

Commit bfce772

Browse files
committed
Add GH action
1 parent 73c2e0d commit bfce772

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
13+
- name: Set up Go
14+
uses: actions/setup-go@v5
15+
with:
16+
go-version-file: 'go.mod'
17+
cache: true
18+
19+
- name: Check formatting
20+
run: |
21+
files=$(gofmt -s -l $(git ls-files "*.go"))
22+
if [ -n "$files" ]; then
23+
echo "The following files are not gofmt-formatted:" >&2
24+
echo "$files" >&2
25+
echo "Run: gofmt -s -w ." >&2
26+
exit 1
27+
fi
28+
29+
- name: Build
30+
run: make build
31+

0 commit comments

Comments
 (0)