-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (43 loc) · 1.42 KB
/
run-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
name: Unit tests
on:
push:
workflow_call:
jobs:
container_job:
name: Unit tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11']
pydantic-version: ['2.3.0', 'lockfile']
fastapi-version: ['0.103.1', 'lockfile']
fail-fast: false
container: python:${{ matrix.python-version }}-slim
steps:
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v3
- name: Install dependencies
run: |
apt update
apt install curl git build-essential libpq-dev libffi-dev -y
python -m pip install --upgrade pip
pip install flit
flit install --deps develop
if [ "${{ matrix.pydantic-version }}" != "lockfile" ]; then
pip install pydantic[email]~=${{ matrix.pydantic-version }}
fi
if [ "${{ matrix.fastapi-version }}" != "lockfile" ]; then
pip install fastapi~=${{ matrix.fastapi-version }}
else
flit install --extras fastapi
fi
env:
FLIT_ROOT_INSTALL: 1
- name: Run Unit tests
run: pytest --cov-branch --cov=pydantic_forms --cov-report=xml
# - name: "Upload coverage to Codecov"
# uses: codecov/codecov-action@v2
# with:
# fail_ci_if_error: true
# files: ./coverage.xml