1
+ ---
1
2
name : Testing
2
3
3
4
on :
12
13
runs-on : ubuntu-latest
13
14
steps :
14
15
- name : Check out code
15
- uses : actions/checkout@v2
16
+ uses : actions/checkout@v3
16
17
- name : golangci-lint
17
18
uses : golangci/golangci-lint-action@v2
19
+ with :
20
+ only-new-issues : ${{ github.event_name == 'pull_request' }}
18
21
19
22
go-test :
20
23
name : Go ${{ matrix.go }} Test
23
26
24
27
strategy :
25
28
matrix :
26
- go : [ '~ 1.17', '~ 1.18' ]
29
+ go : [ '1.17', '1.18', '1.19 ' ]
27
30
28
31
services :
29
32
postgres :
@@ -41,12 +44,13 @@ jobs:
41
44
--health-retries 5
42
45
43
46
steps :
47
+ - name : Check out code
48
+ uses : actions/checkout@v3
44
49
- name : Set up Go
45
- uses : actions/setup-go@v2
50
+ uses : actions/setup-go@v3
46
51
with :
47
52
go-version : ${{ matrix.go }}
48
- - name : Check out code
49
- uses : actions/checkout@v2
53
+
50
54
- name : Run unit tests
51
55
run : make test-unit
52
56
- name : Run examples tests
64
68
steps :
65
69
- name : Done
66
70
run : echo "All Golang versions tests are Green!"
71
+
72
+ test-non-public-schema :
73
+ name : Test non-public PG schema
74
+ runs-on : ubuntu-latest
75
+ needs : [ lint ]
76
+
77
+ services :
78
+ postgres :
79
+ image : postgres:10
80
+ ports :
81
+ - " 5432"
82
+ env :
83
+ POSTGRES_USER : goengine
84
+ POSTGRES_PASSWORD : goengine
85
+ POSTGRES_DB : goengine
86
+ options : >-
87
+ --health-cmd pg_isready
88
+ --health-interval 10s
89
+ --health-timeout 5s
90
+ --health-retries 5
91
+
92
+ steps :
93
+ - name : Check out code
94
+ uses : actions/checkout@v3
95
+ - name : Set up Go
96
+ uses : actions/setup-go@v3
97
+ with :
98
+ go-version-file : ./go.mod
99
+
100
+ - name : Run unit tests
101
+ run : make test-unit
102
+ - name : Run examples tests
103
+ run : make test-examples
104
+ - name : Run integration tests
105
+ run : make test-integration
106
+ env :
107
+ # integration tests suite creates new DB per test run and initialises schema as well
108
+ POSTGRES_DSN : ' postgres://goengine:goengine@localhost:${{ job.services.postgres.ports[5432] }}/goengine?sslmode=disable&search_path=custom'
0 commit comments