-
Notifications
You must be signed in to change notification settings - Fork 3
63 lines (55 loc) · 1.61 KB
/
test-backend.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
name: Test Backend
on:
push:
branches: [main]
paths:
- "backend/**"
- "!backend/README.md"
- ".github/workflows/test-backend.yaml"
pull_request:
branches: [main]
paths:
- "backend/**"
- "!backend/README.md"
- ".github/workflows/test-backend.yaml"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
test:
name: Test Code
runs-on: ubuntu-latest
defaults:
run:
# Step into backend
working-directory: ./backend
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: "3.9.*"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry config virtualenvs.create false
poetry install --no-interaction --no-ansi
- name: Start PostgreSQL
run: |
sudo systemctl start postgresql.service
pg_isready
- name: Run tests
env:
VERSION: test
RELEASEID: test
DB_URI: postgresql+asyncpg://postgres@localhost/postgres
run: |
python -m pytest --cov=app --cov-report=xml
- name: Codecov
# You may pin to the exact commit or the version.
# uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b
uses: codecov/codecov-action@v2
with:
# Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome)
flags: backend # optional