-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (46 loc) · 1.05 KB
/
fmt-build.yaml
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main
pull_request:
branches:
- main
name: Fmt
jobs:
gofmt:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Format sources
run: |
test -z $(gofmt -s -l .)
build-examples:
name: Build all examples
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Build all examples
run: |
for example in $(ls v2/examples/*/*.go); do
if ! $(go build $example); then
exit 1
fi
done
test:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Test
run: |
for t in $(ls v2/tests/*.go); do
if ! $(go test $t); then
exit 1
fi
done