Merge pull request #56 from lan496/dependabot/github_actions/codecov/… #120
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: testing | |
on: | |
push: | |
branches: [master, develop] | |
pull_request: | |
branches: [master] | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# https://github.com/actions/cache/blob/main/examples.md#python---pip | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/setup.py') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.python-version }}-pip- | |
- name: Install | |
run: | | |
python -m pip install --upgrade pip | |
pip install -e .[dev] | |
- name: Test with pytest | |
run: | | |
python -m pytest -v --cov=hsnf --cov-config=setup.cfg --cov-report=xml tests/ | |
- name: Upload coverage to Codecov | |
if: matrix.python-version == '3.9' | |
uses: codecov/codecov-action@v5 | |
with: | |
file: ./coverage.xml | |
flags: unittests | |
fail_ci_if_error: false |