-
Notifications
You must be signed in to change notification settings - Fork 3
43 lines (38 loc) · 1.2 KB
/
pytest-with-coverage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: PyTest with coverage conda
on:
push:
branches: [ '*' ]
jobs:
pytest-with-coverage:
permissions:
contents: read
pull-requests: write
strategy:
fail-fast: false
matrix:
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ]
runs-on: 'ubuntu-latest'
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up mamba environment
uses: mamba-org/setup-micromamba@v1
with:
generate-run-shell: true
environment-file: envs/environment-test.yml
# environment caching does not play nicely with --editable installed packages
cache-environment: false
cache-downloads: true
# persist downloads cache for 1 day
cache-downloads-key: downloads-${{ steps.date.outputs.date }}
create-args: >-
python=${{ inputs.python-version }}
- name: Test with pytest
run: |
pytest --cov=$GITHUB_WORKSPACE --cov-report=xml
shell: micromamba-shell {0}
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests