-
Notifications
You must be signed in to change notification settings - Fork 10
65 lines (62 loc) · 1.67 KB
/
ci-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
on: [pull_request]
jobs:
ci-test:
runs-on: ubuntu-latest
# Service containers to run with `container-job`
services:
# pg test
postgres:
# Docker Hub image
image: postgres:15
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: mochi_local_test
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 25433:5432
# pg local
postgres_local:
# Docker Hub image
image: postgres:15
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: mochi_local
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5434:5432
# chrome
chrome:
# Docker Hub image
image: browserless/chrome
ports:
- 3000:3000
# redis
redis:
image: redis:6
ports:
- 6379:6379
name: CI testing
steps:
- uses: actions/checkout@v3
- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v4
with:
go-version-file: go.mod
- name: Install
run: go install github.com/rubenv/sql-migrate/sql-migrate@latest
- name: Migrate pg local
run: make migrate-up
- name: Run Test cases
run: make test