-
Notifications
You must be signed in to change notification settings - Fork 4
103 lines (93 loc) · 2.81 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: CI
on:
push:
branches:
- 'main'
pull_request:
branches:
- '*'
schedule:
- cron: '0 0 * * *' # Daily “At 00:00”
workflow_dispatch: # allows you to trigger manually
jobs:
build:
name: Build (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- name: Set environment variables
run: |
if [[ ${{ matrix.os }} == windows* ]] ;
then
echo "CONDA_ENV_FILE=ci/environment-windows.yml" >> $GITHUB_ENV
else
echo "CONDA_ENV_FILE=ci/environment.yml" >> $GITHUB_ENV
fi
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
- name: Set up conda environment with micromamba
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: ci/environment.yml
environment-name: dev-feisty
extra-specs: python=${{ matrix.python-version }}
- name: Use old versions of packages where conda is out of sync with version support
run: |
if [[ ${{ matrix.python-version }} == 3.7 ]] ;
then
echo "Need to use older versions of zipp and zarr"
micromamba install zarr=2.14.2 zipp=3.15.0
else
echo "Not modifying conda environment"
fi
- name: Show conda environment
shell: bash -l {0}
run: |
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@v1
with:
file: ./coverage.xml
flags: unittests
env_vars: RUNNER_OS,PYTHON_VERSION
name: codecov-umbrella
fail_ci_if_error: false
build-docs:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
os: [ubuntu-latest]
# python-version: [3.8]
steps:
- uses: actions/checkout@v2
# Install dependencies
- name: Set up conda environment with micromamba
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: ci/environment.yml
environment-name: dev-feisty
extra-specs: python=${{ matrix.python-version }}
- name: Show conda environment
shell: bash -l {0}
run: |
conda list
# Build the book
- name: Build the book
run: |
jupyter-book build docs/ --all