-
Notifications
You must be signed in to change notification settings - Fork 427
171 lines (171 loc) · 4.93 KB
/
ci.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: CI
on:
push:
paths-ignore:
- '.cookiecutter/*'
- '.github/dependabot.yml'
- '.github/workflows/deploy.yml'
- '.github/workflows/redeploy.yml'
- 'bin/logger'
- 'conf/development.ini'
- 'production.ini'
- 'conf/supervisord*.conf'
- 'docs/*'
- 'requirements/*.in'
- 'requirements/dev.txt'
- '**/.gitignore'
- 'Dockerfile'
- 'LICENSE'
- '*.md'
- 'docker-compose.yml'
workflow_dispatch:
workflow_call:
schedule:
- cron: '0 1 * * *'
jobs:
Format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Cache the .tox dir
uses: actions/cache@v3
with:
path: .tox
key: format-${{ runner.os }}-tox-${{ hashFiles('tox.ini') }}-${{ hashFiles('requirements/*') }}
restore-keys: |
format-${{ runner.os }}-tox-
- run: python -m pip install 'tox<4'
- run: tox -e checkformatting
Lint:
runs-on: ubuntu-latest-32-cores
steps:
- uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Cache the .tox dir
uses: actions/cache@v3
with:
path: .tox
key: lint-${{ runner.os }}-tox-${{ hashFiles('tox.ini') }}-${{ hashFiles('requirements/*') }}
restore-keys: |
lint-${{ runner.os }}-tox-
- run: python -m pip install 'tox<4'
- run: tox -e lint
Tests:
runs-on: ubuntu-latest-32-cores
services:
postgres:
image: postgres:15.6-alpine
ports:
- 5432:5432
env:
POSTGRES_HOST_AUTH_METHOD: trust
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
elasticsearch:
image: hypothesis/elasticsearch:elasticsearch7.10
ports:
- 9200:9200
env:
discovery.type: single-node
steps:
- uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Cache the .tox dir
uses: actions/cache@v3
with:
path: .tox
key: tests-${{ runner.os }}-tox-${{ hashFiles('tox.ini') }}-${{ hashFiles('requirements/*') }}
restore-keys: |
tests-${{ runner.os }}-tox-
- name: Create test database
run: psql -U postgres -h localhost -p 5432 -c 'CREATE DATABASE h_tests'
- run: python -m pip install 'tox<4'
- run: tox -e tests
env:
COVERAGE_FILE: .coverage.${{ matrix.python-version }}
- name: Upload coverage file
uses: actions/upload-artifact@v4
with:
name: coverage
path: .coverage.*
include-hidden-files: true
Coverage:
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Cache the .tox dir
uses: actions/cache@v3
with:
path: .tox
key: coverage-${{ runner.os }}-tox-${{ hashFiles('tox.ini') }}-${{ hashFiles('requirements/*') }}
restore-keys: |
coverage-${{ runner.os }}-tox-
- name: Download coverage files
uses: actions/download-artifact@v4
with:
name: coverage
- run: python -m pip install 'tox<4'
- run: tox -e coverage
Functests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15.6-alpine
ports:
- 5432:5432
env:
POSTGRES_HOST_AUTH_METHOD: trust
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
elasticsearch:
image: hypothesis/elasticsearch:elasticsearch7.10
ports:
- 9200:9200
env:
discovery.type: single-node
rabbitmq:
image: rabbitmq:3.12-management-alpine
ports:
- 5672:5672
steps:
- uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Cache the .tox dir
uses: actions/cache@v3
with:
path: .tox
key: functests-${{ runner.os }}-tox-${{ hashFiles('tox.ini') }}-${{ hashFiles('requirements/*') }}
restore-keys: |
functests-${{ runner.os }}-tox-
- name: Create test database
run: psql -U postgres -h localhost -p 5432 -c 'CREATE DATABASE h_functests'
- run: python -m pip install 'tox<4'
- run: yarn install --immutable
- run: yarn build
- run: tox -e functests
Frontend:
uses: ./.github/workflows/frontend.yml