forked from alexedwards/scs
-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (86 loc) · 2.51 KB
/
Copy pathgo.yml
File metadata and controls
103 lines (86 loc) · 2.51 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Go
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
test:
runs-on: ubuntu-latest
services:
mysql:
image: mysql
env:
MYSQL_ROOT_PASSWORD: root-password
MYSQL_DATABASE: dbname
MYSQL_USER: user
MYSQL_PASSWORD: password
options: >-
--health-cmd "mysqladmin ping --silent"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 3306:3306
postgres:
image: postgres
env:
POSTGRES_DB: dbname
POSTGRES_USER: user
POSTGRES_PASSWORD: password
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.20'
- name: Test
run: go test -race -v ./...
- name: Run postgres migrations
run: psql -f pgxstore/testdata/schema.sql postgres://user:password@localhost:5432/dbname
- name: Run mysql migrations
run: mysql --protocol=TCP --host=localhost --port=3306 --user=user --password=password dbname < mysqlstore/testdata/schema.sql
- name: Test goredisstore
env:
SCS_REDIS_TEST_DSN: redis://localhost:6379
working-directory: goredisstore
run: go test -race -v ./...
- name: Test mysqlstore
env:
SCS_MYSQL_TEST_DSN: user:password@tcp(localhost:3306)/dbname
working-directory: mysqlstore
run: go test -race -v ./...
- name: Test pgxstore
env:
SCS_POSTGRES_TEST_DSN: postgres://user:password@localhost:5432/dbname
working-directory: pgxstore
run: go test -race -v ./...
- name: Test postgresstore
env:
SCS_POSTGRES_TEST_DSN: postgres://user:password@localhost:5432/dbname?sslmode=disable
working-directory: postgresstore
run: go test -race -v ./...
- name: Test redisstore
env:
SCS_REDIS_TEST_DSN: localhost:6379
working-directory: redisstore
run: go test -race -v ./...
- name: Test sqlite3store
working-directory: sqlite3store
run: go test -race -v ./...