forked from xarray-contrib/cf-xarray
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (77 loc) · 2.19 KB
/
ci.yaml
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: CI
on:
push:
branches:
- "main"
pull_request:
branches:
- "*"
schedule:
- cron: "0 13 * * 1"
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v3
with:
# need to fetch all tags to get a correct version
fetch-depth: 0 # fetch all branches and tags
- uses: conda-incubator/setup-miniconda@v2
with:
channels: conda-forge
mamba-version: "*"
activate-environment: cf_xarray_test
auto-update-conda: false
python-version: ${{ matrix.python-version }}
- name: Set up conda environment
shell: bash -l {0}
run: |
mamba env update -f ci/environment.yml
python -m pip install -e .
conda list
- name: Run Tests
shell: bash -l {0}
run: |
pytest --cov=./ --cov-report=xml
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false
no-optional-deps:
name: no-optional-deps
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# need to fetch all tags to get a correct version
fetch-depth: 0 # fetch all branches and tags
- uses: conda-incubator/setup-miniconda@v2
with:
channels: conda-forge
mamba-version: "*"
activate-environment: cf_xarray_test
auto-update-conda: false
python-version: ${{ matrix.python-version }}
- name: Set up conda environment
shell: bash -l {0}
run: |
mamba env update -f ci/environment-no-optional-deps.yml
python -m pip install -e .
conda list
- name: Run Tests
shell: bash -l {0}
run: |
pytest -n 2