-
Notifications
You must be signed in to change notification settings - Fork 6
112 lines (93 loc) · 2.56 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Go
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Fill in version
run: sed -i 's/"YXZ"/"${GITHUB_SHA}"/g' symbol/version.go
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Build
run: go build -v ./...
test:
needs: build
runs-on: ubuntu-latest
services:
rabbit_mq:
image: rabbitmq:3.8
env:
RABBITMQ_DEFAULT_USER: rabbitmq_user
RABBITMQ_DEFAULT_PASS: rabbitmq_pass
ports:
- 5672:5672
redis:
# Docker Hub image
image: redis
ports:
- 6379:6379
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres:
image: postgres:11
env:
POSTGRES_DB: db_name
POSTGRES_PASSWORD: db_pass
POSTGRES_USER: db_user
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: debug
run: |
printenv
pwd
- name: Set up Python 3
uses: actions/setup-python@v3
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
cd migration/mock
python -m pip install -r requirements.txt
python mock.py
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Build
run: go build
- name: Check services
run: ./infomark console configuration test .infomark-ci.yml
- name: Migrate Database
run: INFOMARK_CONFIG_FILE=`realpath .infomark-ci.yml` ./infomark console database migrate
- name: Seed Database
run: |
cd migration/mock
PGPASSWORD=db_pass psql -h 'localhost' -U 'db_user' -d 'db_name' -f mock.sql
- name: Run unit tests
run: |
export INFOMARK_CONFIG_FILE=`realpath .infomark-ci.yml`
go test ./... -cover -v --goblin.timeout 15s -coverprofile coverage.out