-
Notifications
You must be signed in to change notification settings - Fork 6
87 lines (87 loc) · 2.23 KB
/
main.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
83
84
85
86
87
name: Test
on: [push, pull_request]
jobs:
test:
# matrix strategy from: https://github.com/mvdan/github-actions-golang/blob/master/.github/workflows/test.yml
strategy:
matrix:
go-version:
- 1.18.10
- 1.19.7
- 1.20.2
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v3
- name: Run tests
run: go test -race ./...
sql-test-18:
strategy:
matrix:
containers:
- 1.18.10-bullseye
runs-on: ubuntu-latest
container: golang:${{ matrix.containers }}
env:
PGPASSWORD: pgpwd
PGHOST: postgres
PGUSER: postgres
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run sqlx driver tests
run: cd db/sql && go test -race ./...
- name: Run pgx driver tests
run: cd db/pgx && go test -race ./...
services:
postgres:
image: postgres:13.3
env:
POSTGRES_PASSWORD: pgpwd
sql-test-19:
strategy:
matrix:
containers:
- 1.19.7-bullseye
- 1.20.2-bullseye
runs-on: ubuntu-latest
container: golang:${{ matrix.containers }}
env:
PGPASSWORD: pgpwd
PGHOST: postgres
PGUSER: postgres
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run sqlx driver tests
run: cd db/sql && go test -race ./...
- name: Run pgx driver tests
run: cd db/pgx && go test -race ./...
- name: Run pgx/v5 driver tests
run: cd db/pgx/v5 && go test -race ./...
services:
postgres:
image: postgres:13.3
env:
POSTGRES_PASSWORD: pgpwd