-
Notifications
You must be signed in to change notification settings - Fork 18
191 lines (183 loc) · 6.24 KB
/
main.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
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
name: CI
env:
micromamba_version: 1.5
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_0:
name: wradlib notebooks - linux
runs-on: ubuntu-20.04
defaults:
run:
shell: bash -l {0}
env:
WRADLIB_DATA: ./wradlib-data
CONDA_ENV_FILE: ci/requirements/notebooks.yml
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install micromamba environment
uses: mamba-org/setup-micromamba@v1
with:
environment-name: wradlib-notebooks
environment-file: ${{env.CONDA_ENV_FILE}}
cache-environment: true
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
create-args: >-
python=${{matrix.python-version}}
- name: Install wradlib
run: |
git clone https://github.com/wradlib/wradlib.git
cd wradlib
echo "WRADLIB_TAG=`git name-rev --name-only --tags HEAD`" >> $GITHUB_ENV
python -m pip install . --no-deps
- name: Install wradlib-data
run: |
python -m pip install git+https://github.com/wradlib/wradlib-data@pooch
mkdir ./wradlib-data
- name: Version Info
run: |
python -c "import wradlib; print(wradlib.version.version)"
python -c "import wradlib; print(wradlib.show_versions())"
- name: Render with pytest
env:
WRADLIB_EARTHDATA_BEARER_TOKEN: ${{ secrets.WRADLIB_EARTHDATA_BEARER_TOKEN }}
run: |
export WRADLIB_DATA=`realpath $WRADLIB_DATA`
pytest -n auto --verbose --durations=15 --pyargs notebooks
- name: Commit files
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
run: |
git config --global user.email "wradlib-docs@wradlib.org"
git config --global user.name "wradlib-docs-bot"
git checkout --orphan render
git add --all .
git commit -m "Rendering at commit $GITHUB_SHA"
- name: Push changes
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
run: |
if [ $WRADLIB_TAG == 'undefined' ]; then
BRANCH=devel
else
BRANCH=$WRADLIB_TAG
fi
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/wradlib/wradlib-notebooks.git render:$BRANCH -fq
build_1:
name: wradlib notebooks - macosx
runs-on: macos-latest
defaults:
run:
shell: bash -l {0}
env:
WRADLIB_DATA: ./wradlib-data
CONDA_ENV_FILE: ci/requirements/notebooks.yml
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install micromamba environment
uses: mamba-org/setup-micromamba@v1
with:
environment-name: wradlib-notebooks
environment-file: ${{env.CONDA_ENV_FILE}}
cache-environment: true
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
create-args: >-
python=${{matrix.python-version}}
- name: Install wradlib
run: |
git clone https://github.com/wradlib/wradlib.git
cd wradlib
echo "WRADLIB_TAG=`git name-rev --name-only --tags HEAD`" >> $GITHUB_ENV
python -m pip install . --no-deps
- name: Install wradlib-data
run: |
python -m pip install git+https://github.com/wradlib/wradlib-data@pooch
mkdir ./wradlib-data
- name: Version Info
run: |
python -c "import wradlib; print(wradlib.version.version)"
python -c "import wradlib; print(wradlib.show_versions())"
- name: Render with pytest
env:
WRADLIB_EARTHDATA_BEARER_TOKEN: ${{ secrets.WRADLIB_EARTHDATA_BEARER_TOKEN }}
run: |
export WRADLIB_DATA=`python -c "import os, sys; print(os.path.realpath(sys.argv[1]))" $WRADLIB_DATA`
pytest -n auto --verbose --durations=15 --pyargs notebooks
build_2:
name: wradlib notebooks - windows
runs-on: windows-latest
defaults:
run:
shell: bash -l {0}
env:
WRADLIB_DATA: ./wradlib-data
CONDA_ENV_FILE: ci/requirements/notebooks.yml
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install micromamba environment
uses: mamba-org/setup-micromamba@v1
with:
environment-name: wradlib-notebooks
environment-file: ${{env.CONDA_ENV_FILE}}
cache-environment: true
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
create-args: >-
python=${{matrix.python-version}}
- name: Install wradlib
run: |
git clone https://github.com/wradlib/wradlib.git
cd wradlib
python -m pip install . --no-deps
- name: Install wradlib-data
run: |
python -m pip install git+https://github.com/wradlib/wradlib-data@pooch
mkdir ./wradlib-data
- name: Version Info
run: |
python -c "import wradlib; print(wradlib.version.version)"
python -c "import wradlib; print(wradlib.show_versions())"
- name: Test with pytest
env:
WRADLIB_EARTHDATA_BEARER_TOKEN: ${{ secrets.WRADLIB_EARTHDATA_BEARER_TOKEN }}
run: |
export WRADLIB_DATA=`python -c "import os, sys; print(os.path.realpath(sys.argv[1]))" $WRADLIB_DATA`
pytest -n auto --verbose --durations=15 --pyargs notebooks
trigger_rtd:
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
needs: [build_0]
name: trigger readthedocs
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
env:
RTD_TOKEN: ${{ secrets.RTD_TOKEN }}
RTD_URL: ${{ secrets.RTD_URL }}
steps:
- name: trigger readthedocs
run: |
echo "triggering"
curl -X POST -H "Authorization: Token $RTD_TOKEN" "$RTD_URL"