forked from middlewarehq/middleware
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (37 loc) · 943 Bytes
/
pytest.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
name: Unit Tests
on:
pull_request:
branches: [ "main" ]
paths:
- 'backend/**'
- '**/*.py'
push:
branches: [ "main" ]
paths:
- 'backend/**'
- '**/*.py'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11.6'
- name: Install dependencies
run: |
cd ./backend
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Test with pytest
env:
DB_HOST: "localhost"
DB_NAME: "mhq-oss"
DB_PASS: "postgres"
DB_PORT: 5432
DB_USER: "postgres"
run: |
pip install pytest pytest-cov
pytest ./backend/analytics_server/tests/ --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html