-
Notifications
You must be signed in to change notification settings - Fork 363
50 lines (47 loc) · 1.41 KB
/
backend_unit_tests.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
name: Backend unit tests
on:
push:
branches: [main]
pull_request: {}
merge_group: {}
jobs:
pytest:
permissions: write-all
# environment: development
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
virtualenvs-path: .venv
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --with dev --no-interaction --no-root
- name: Setup test DB container
run: make test-db
- name: Test with pytest
if: github.actor != 'dependabot[bot]'
run: |
make run-unit-tests
env:
PYTHONPATH: src
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml