-
Notifications
You must be signed in to change notification settings - Fork 5
65 lines (54 loc) · 1.39 KB
/
test.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: unit-tests
on:
push:
branches: [ master, v2-wip ]
pull_request:
branches: [ master, v2-wip]
jobs:
build:
env:
GOFLAGS: "-mod=vendor"
name: Build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Set up gotestfmt
uses: gotesttools/gotestfmt-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Environment info
shell: bash
run: |
echo "Go Version:"
go version
echo "\nGo env:"
go env
echo "\nPATH:"
echo $PATH
- name: Build
shell: bash
run: go build -v .
- name: Test
shell: bash
run: go test -v . -json 2>&1 | gotestfmt -hide empty-packages
id: test
continue-on-error: true
- name: Raw Test (debug mode only)
shell: bash
if: runner.debug == '1'
run: go test -v .
id: debug
continue-on-error: true
- name: Tests Successful
shell: bash
if: steps.test.outcome == 'failure' || steps.debug.outcome == 'failure'
run: exit 1