Skip to content

add regression test workflow #1

add regression test workflow

add regression test workflow #1

Workflow file for this run

name: run tests and check coverage
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout repo content
uses: actions/checkout@v2 # checkout the repository content
- name: setup python
uses: actions/setup-python@v4
with:
python-version: '3.10' # install the python version needed
- name: install python packages
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: run pytest
id: test_step
run: pytest tests
- name: Fail workflow if tests were failed
if: ${{ steps.test_step.outcome == 'failure' }}
run: exit 1
- name: run coverage
id: test_cov_step
run: |
coverage run -m pytest tests
coverage report -m | awk '/TOTAL/ {print ($4 > 70)}'
- name: Fail workflow if test coverage score is below threshold
if: ${{ steps.test_cov_step.outcome == 0 }}
run: exit 1