GitHub Actions: Upgrade to codecov v4 #132
Workflow file for this run
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: Tests | |
on: [push, pull_request] | |
jobs: | |
unittests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
django-version: ["django~=3.2", "django~=4.2", "django~=5.0"] | |
optional-dependencies: ["optional-deps", "no-optional-deps"] | |
exclude: | |
- python-version: "3.8" | |
django-version: "django~=5.0" | |
- python-version: "3.9" | |
django-version: "django~=5.0" | |
env: | |
OS: ubuntu-latest | |
PYTHON: ${{ matrix.python-version }} | |
DJANGO: ${{ matrix.django-version }} | |
steps: | |
- uses: actions/checkout@master | |
- name: Setup Python | |
uses: actions/setup-python@master | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
pip install pytest-cov "${{ matrix.django-version }}" | |
pip install -e .[test] | |
- name: Install optional dependencies | |
if: matrix.optional-dependencies == 'optional-deps' | |
run: pip install -e .[optional] | |
- name: Run tests and generate coverage report | |
run: pytest --cov=./ --cov-report=xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
env_vars: OS,PYTHON,DJANGO | |
fail_ci_if_error: true | |
files: coverage.xml | |
flags: unittests | |
name: codecov-umbrella | |
token: ${{ secrets.CODECOV_TOKEN }} | |
verbose: true |