-
Notifications
You must be signed in to change notification settings - Fork 35
67 lines (59 loc) · 1.51 KB
/
unittesting-pytest.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
name: "Unit tests with pytest"
on:
push:
paths-ignore:
- 'docs/**'
- '.github/**'
branches:
- master
- develop
- "release/**"
pull_request:
paths-ignore:
- 'docs/**'
- '.github/**'
branches:
- "**"
workflow_dispatch:
jobs:
unittest-pytests:
strategy:
matrix:
python_version: ["3.9", "3.10", "3.11", "3.12"]
os:
- ubuntu-24.04
runs-on: ${{ matrix.os }}
services:
postgres:
image: postgres:13
ports:
- 5432:5432
env:
POSTGRES_USER: unittest_username
POSTGRES_PASSWORD: unittest_password
POSTGRES_DB: fedn_db
mongo:
image: mongo:4.4
ports:
- 27017:27017
env:
MONGO_INITDB_ROOT_USERNAME: unittest_username
MONGO_INITDB_ROOT_PASSWORD: unittest_password
steps:
- name: checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install -r fedn/tests/requirements.txt
- name: Run tests
env:
UNITTEST_DBUSER: unittest_username
UNITTEST_DBPASS: unittest_password
UNITTEST_GITHUB: True
run: |
pytest --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html