Skip to content

Commit

Permalink
Add unittest workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rmazzine committed Aug 31, 2023
1 parent 19ce4e4 commit 32ba1d8
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/unittests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Python Unit Tests with Codecov

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:

runs-on: ubuntu-latest

strategy:
matrix:
python-version: [3.7, 3.8, 3.9]

steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest pytest-cov
pip install .
- name: Run tests with coverage
run: |
pytest --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true

0 comments on commit 32ba1d8

Please sign in to comment.