-
Notifications
You must be signed in to change notification settings - Fork 107
68 lines (54 loc) · 1.41 KB
/
ci.yaml
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
name: CI
on: [workflow_dispatch, pull_request]
env:
SECRET_KEY: thisisasecret
DATABASE_URL: postgresql://postgres:password@localhost:5432/postgres
jobs:
ci:
runs-on: ubuntu-20.04
services:
postgres:
image: postgres:11-alpine
ports:
- 5432:5432
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'poetry'
- name: Set up Python dependencies
run: |
poetry install
- uses: actions/setup-node@v3
with:
node-version: 8
- name: Setup Yarn install
uses: borales/actions-yarn@v4
with:
cmd: install
- name: Run ruff on src
run: |
poetry run ruff check src
- name: Run DB migration for test
run: |
poetry run python src/manage.py migrate --verbosity 1 --noinput
- name: Run Test
run: |
cd src
poetry run pytest -n 2 --cov=. --cov-report=term-missing --cov-report=xml
- name: Run Codecov action
uses: codecov/codecov-action@v3