-
Notifications
You must be signed in to change notification settings - Fork 18
90 lines (86 loc) · 2.81 KB
/
render.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
name: Render
env:
micromamba_version: 1.5
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_0:
name: wradlib notebooks - linux
runs-on: ubuntu-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
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
trigger_rtd:
if: 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"