-
Notifications
You must be signed in to change notification settings - Fork 24
36 lines (30 loc) · 940 Bytes
/
go.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Go
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
go:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Go
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version: stable
- name: Check formatting
run: |
gofmt -w -s .
if [[ -n $(git diff --exit-code) ]]; then
echo "Go files were not formatted correctly:"
git diff
exit 1
fi
- name: Build examples
working-directory: examples/go/
run: for DIR in $(find . -name 'go.mod'); do cd $(dirname $DIR); go build || exit 1; cd -; done
- name: Run util tests
working-directory: util/
run: for DIR in $(find . -name 'go.mod'); do cd $(dirname $DIR); go test ./... || exit 1; cd -; done