Skip to content

End-to-end tests

End-to-end tests #113

Workflow file for this run

# This workflow will install Python dependencies and run tests with a single version of Python
# For more information see:
# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: build
on:
push:
branches:
- main
pull_request:
branches:
- '*'
permissions:
contents: read
jobs:
build:
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 -r tests/requirements.txt
- name: Test with pytest
run: |
coverage run -m pytest \
-c ./tests/pytest.ini \
-W ignore::pytest.PytestCollectionWarning \
--md-report --md-report-output=report.md --md-report-color=never \
tests || pytest_exit_code=$?
echo "## :clipboard: Test Results" >> $GITHUB_STEP_SUMMARY
cat report.md >> $GITHUB_STEP_SUMMARY
echo "## :bar_chart: Code coverage" >> $GITHUB_STEP_SUMMARY
coverage report --format markdown >> $GITHUB_STEP_SUMMARY
if [[ "$(coverage report --format total)" -lt 80 ]]
then
echo "::error::Code coverage is less than 80%" && exit_code=1
fi
if [[ $pytest_exit_code -gt 0 ]]
then
echo "::error::Unit tests failed" && exit_code=1
fi
exit $exit_code