Feature/SK-1471 | Add option to configure statestore with environment variables #118
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |