-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (54 loc) · 1.55 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
name: CI
on:
push:
paths-ignore:
- '.cookiecutter/*'
- 'docs/*'
- 'requirements/*.in'
- 'requirements/dev.txt'
- '**/.gitignore'
- '*.md'
- 'LICENSE'
workflow_call:
jobs:
backend:
name: Backend
runs-on: ubuntu-latest
env:
TOX_PARALLEL_NO_SPINNER: 1
services:
postgres:
image: postgres:15.6-alpine
ports:
- 5434:5432
env:
POSTGRES_HOST_AUTH_METHOD: trust
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout git repo
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version-file: '.python-version'
- name: Update pip
run: python -m pip install --upgrade pip
- name: Install tox
run: python -m pip install 'tox<4'
- name: Create test databases
run: |
psql -U postgres -h localhost -p 5434 -c 'CREATE DATABASE checkmate_test'
psql -U postgres -h localhost -p 5434 -c 'CREATE DATABASE checkmate_functests'
- name: Cache the .tox dir
uses: actions/cache@v3
with:
path: .tox
key: ${{ runner.os }}-tox-${{ secrets.CACHE_VERSION }}-${{ hashFiles('tox.ini', 'requirements*', 'setup.py', 'setup.cfg') }}
restore-keys: |
${{ runner.os }}-tox-${{ secrets.CACHE_VERSION }}-
- name: Run tox
run: tox --parallel auto -e lint,checkformatting,tests,coverage,functests