Skip to content

Move tests to pytest #9

Move tests to pytest

Move tests to pytest #9

Workflow file for this run

name: Run tests
on:
pull_request:
branches:
- main
# Allows manual run from the Actions tab
workflow_dispatch:
# Allows re-use in other workflows
workflow_call:
jobs:
run-tests:
name: Run tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: [3.9]
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install optional dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get install libsnappy-dev
shell: bash
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[test] --extra-index-url=https://packages.idmod.org/api/pypi/pypi-production/simple
- name: Run unit tests
run: |
cd tests
python -m pytest --dist loadfile -v --junitxml="test_results.xml"
- name: Upload emodpy test results
uses: actions/upload-artifact@v4
if: failure()
with:
name: emodpy_test_results
path: tests/test_results.xml