-
Notifications
You must be signed in to change notification settings - Fork 11
49 lines (42 loc) · 1.1 KB
/
pytest.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
44
45
46
47
48
49
name: pytest
on:
push:
branches: [ main ]
paths:
- 'cmeutils/**'
- environment-dev.yml
- .github/workflows/pytest.yml
pull_request:
branches: [ main ]
paths:
- 'cmeutils/**'
- environment-dev.yml
- .github/workflows/pytest.yml
# Allows workflow to be manually triggered
workflow_dispatch:
jobs:
pytest:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.10", "3.11", "3.12"]
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Build environment
uses: mamba-org/setup-micromamba@v2
with:
environment-file: environment-dev.yml
create-args: >-
python=${{ matrix.python-version }}
- name: Install package
shell: bash -l {0}
run: pip install .
- name: Run pytest with coverage report
shell: bash -l {0}
run: python -m pytest -v -rs --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
file: ./coverage.xml