adding github workflow #1
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: iob-tests | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -e . | |
pip install coverage pytest | |
- name: Run tests | |
run: | | |
echo "Running tests..." | |
COVERAGE_FILE=.coverage_layers python3 -m coverage run --source=iobs -m pytest tests/test_layers.py | |
COVERAGE_FILE=.coverage_sims python3 -m coverage run --source=iobs -m pytest tests/test_simulators.py | |
COVERAGE_FILE=.coverage_models python3 -m coverage run --source=iobs -m pytest tests/test_models.py | |
shell: bash | |
- name: Combine results of unit tests | |
run: | | |
python -m pip install --upgrade pip | |
pip install coverage pytest | |
coverage combine .coverage_layers .coverage_sims .coverage_models | |
coverage xml | |
coverage report -m | |
shell: bash |