-
Notifications
You must be signed in to change notification settings - Fork 367
82 lines (68 loc) · 2.42 KB
/
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
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: GO CI
on:
push:
paths:
- 'golang/**'
- '.github/workflows/go**'
pull_request:
paths:
- 'golang/**'
- '.github/workflows/go**'
schedule:
# weekly build every FRI
- cron: "0 6 * * 5"
jobs:
matrix_build:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ ubuntu-latest, macOS-latest, windows-latest ]
go: [ '1.14', '1.13', '1.12' ]
name: Go ${{ matrix.go }} Build on ${{ matrix.operating-system }}
steps:
- uses: actions/checkout@v3
- name: Setup go
uses: actions/[email protected]
with:
go-version: ${{ matrix.go }}
- name: cache go
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
#### BEGIN testify
- name: run with testify
working-directory: golang/testify
run: |
go mod tidy
go test kata_test.go -v -run TestGen
go test kata_test.go -v -run TestSomething
- name: assure one failing test
working-directory: golang/testify
run: "sh ../../.scripts/assure_failing_test.sh 'go test kata_test.go -v' 'Error Trace: kata_test.go:9'"
#### END testify
#### BEGIN testify test doubles
- name: run with testify
working-directory: golang/testify
run: |
go mod tidy
go test testdoubles_test.go -v -run TestStubIsReturningTrue
go test testdoubles_test.go -v -run TestMockIsCalledWith42
- name: assure one failing test
working-directory: golang/testify
run: "sh ../../.scripts/assure_failing_test.sh 'go test testdoubles_test.go -v -run TestMockIsFailingWhenNotCalledWith42' 'mock: Unexpected Method Call'"
#### END testify test doubles
#### BEGIN ginkgo
- name: run with ginkgo
working-directory: golang/ginkgo
run: go mod tidy
- name: run with ginkgo passing test
working-directory: golang/ginkgo
# no idea how to just run the passing test with ginkgo, therefore this hack:
run: "sh ../../.scripts/assure_failing_test.sh 'go test' '1 Passed'"
- name: assure one failing test
working-directory: golang/ginkgo
run: "sh ../../.scripts/assure_failing_test.sh 'go test' 'Summarizing 1 Failure:'"
#### END ginkgo