Skip to content

Commit c6d0a44

Browse files
committed
Update CI
1 parent bbb402f commit c6d0a44

File tree

1 file changed

+62
-21
lines changed

1 file changed

+62
-21
lines changed

.github/workflows/ci.yaml

Lines changed: 62 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,41 +17,82 @@ jobs:
1717
build:
1818
name: Build (${{ matrix.python-version }}, ${{ matrix.os }})
1919
runs-on: ${{ matrix.os }}
20+
defaults:
21+
run:
22+
shell: bash -l {0}
2023
strategy:
2124
fail-fast: false
2225
matrix:
2326
os: ["ubuntu-latest"]
24-
python-version: ["3.8", "3.9", "3.10"]
27+
python-version: ["3.8", "3.10"]
2528
steps:
2629
- uses: actions/checkout@v3
2730
with:
28-
# need to fetch all tags to get a correct version
29-
fetch-depth: 0 # fetch all branches and tags
30-
- uses: conda-incubator/setup-miniconda@v2
31-
with:
32-
channels: conda-forge
33-
mamba-version: "*"
34-
activate-environment: cf_xarray_test
35-
auto-update-conda: false
36-
python-version: ${{ matrix.python-version }}
31+
fetch-depth: 0 # Fetch all history for all branches and tags.
32+
- name: Set environment variables
33+
run: |
34+
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
3735
- name: Set up conda environment
38-
shell: bash -l {0}
36+
uses: mamba-org/provision-with-micromamba@v14
37+
with:
38+
environment-file: ci/environment.yml
39+
environment-name: cf_xarray_test
40+
cache-env: true
41+
extra-specs: |
42+
python="${{ matrix.python-version }}"
43+
- name: Install cf_xarray
3944
run: |
40-
mamba env update -f ci/environment.yml
41-
python -m pip install -e .
42-
conda list
43-
45+
python -m pip install --no-deps -e .
4446
- name: Run Tests
45-
shell: bash -l {0}
4647
run: |
47-
pytest --cov=./ --cov-report=xml
48+
pytest -n auto --cov=./ --cov-report=xml
49+
- name: Upload code coverage to Codecov
50+
uses: codecov/[email protected]
51+
with:
52+
file: ./coverage.xml
53+
flags: unittests
54+
env_vars: RUNNER_OS,PYTHON_VERSION
55+
name: codecov-umbrella
56+
fail_ci_if_error: false
4857

58+
old-xarray:
59+
name: xarray 2022.03.0
60+
runs-on: "ubuntu-latest"
61+
defaults:
62+
run:
63+
shell: bash -l {0}
64+
strategy:
65+
fail-fast: false
66+
matrix:
67+
python-version: ["3.10"]
68+
steps:
69+
- uses: actions/checkout@v3
70+
with:
71+
fetch-depth: 0 # Fetch all history for all branches and tags.
72+
- name: Set environment variables
73+
run: |
74+
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
75+
- name: Set up conda environment
76+
uses: mamba-org/provision-with-micromamba@v14
77+
with:
78+
environment-file: ci/environment.yml
79+
environment-name: cf_xarray_test
80+
cache-env: true
81+
extra-specs: |
82+
python="${{ matrix.python-version }}"
83+
xarray="2022.03.0"
84+
- name: Install cf_xarray
85+
run: |
86+
python -m pip install --no-deps -e .
87+
- name: Run Tests
88+
run: |
89+
pytest -n auto --cov=./ --cov-report=xml
4990
- name: Upload code coverage to Codecov
50-
uses: codecov/codecov-action@v3
91+
uses: codecov/codecov-action@v3.1.1
5192
with:
5293
file: ./coverage.xml
5394
flags: unittests
54-
env_vars: OS,PYTHON
95+
env_vars: RUNNER_OS,PYTHON_VERSION
5596
name: codecov-umbrella
5697
fail_ci_if_error: false
5798

@@ -61,8 +102,8 @@ jobs:
61102
steps:
62103
- uses: actions/checkout@v3
63104
with:
64-
# need to fetch all tags to get a correct version
65-
fetch-depth: 0 # fetch all branches and tags
105+
# need to fetch all tags to get a correct version
106+
fetch-depth: 0 # fetch all branches and tags
66107
- uses: conda-incubator/setup-miniconda@v2
67108
with:
68109
channels: conda-forge

0 commit comments

Comments
 (0)