-
Notifications
You must be signed in to change notification settings - Fork 13
57 lines (53 loc) · 1.47 KB
/
testing.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
50
51
52
53
54
55
56
57
name: Testing
on:
push:
branches:
- '**'
jobs:
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
with:
src: "./regional_mom6 ./tests"
testing:
needs: formatting
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
strategy:
matrix:
python-version: ["3.9", "3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
auto-activate-base: false
environment-file: environment-ci.yml
python-version: ${{ matrix.python-version }}
- name: Install from source
run: |
python -m pip install .
- name: Install pytest
run: |
python -m pip install pytest pytest-cov
- name: Test with pytest
run: |
if [[ "${{ matrix.python-version }}" == "3.10" ]]; then
python -m pytest --cov=regional_mom6 --cov-report=xml tests/
else
python -m pytest tests/
fi
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
if: ${{ matrix.python-version == '3.10' }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage/reports/
env_vars: OS,PYTHON
files: ./coverage.xml
name: codecov-umbrella