Skip to content

add unit test and coverage #1

add unit test and coverage

add unit test and coverage #1

Workflow file for this run

name: Unit Test
on:
push:
branches: ['main']
pull_request:
branches: ['main']
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install poetry
poetry install
- name: Run pytest with coverage
run: |
poetry run pytest --cov=secured tests/
- name: Generate coverage report
run: |
poetry run pytest --cov=secured --cov-report=xml:coverage.xml tests/
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
file: ./coverage.xml
fail_ci_if_error: true