|
| 1 | +name: CI |
| 2 | +env: |
| 3 | + micromamba_version: 1.5 |
| 4 | + |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: [ main ] |
| 9 | + pull_request: |
| 10 | + branches: [ main ] |
| 11 | + |
| 12 | + workflow_dispatch: |
| 13 | + |
| 14 | +concurrency: |
| 15 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 16 | + cancel-in-progress: true |
| 17 | + |
| 18 | +jobs: |
| 19 | + build_0: |
| 20 | + name: wradlib notebooks - linux |
| 21 | + runs-on: ubuntu-20.04 |
| 22 | + defaults: |
| 23 | + run: |
| 24 | + shell: bash -l {0} |
| 25 | + env: |
| 26 | + WRADLIB_DATA: ./wradlib-data |
| 27 | + CONDA_ENV_FILE: ci/requirements/notebooks.yml |
| 28 | + strategy: |
| 29 | + fail-fast: false |
| 30 | + matrix: |
| 31 | + python-version: ["3.11"] |
| 32 | + steps: |
| 33 | + - uses: actions/checkout@v3 |
| 34 | + with: |
| 35 | + fetch-depth: 0 |
| 36 | + - name: Install micromamba environment |
| 37 | + uses: mamba-org/setup-micromamba@v1 |
| 38 | + with: |
| 39 | + environment-name: wradlib-notebooks |
| 40 | + environment-file: ${{env.CONDA_ENV_FILE}} |
| 41 | + cache-environment: true |
| 42 | + cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}" |
| 43 | + create-args: >- |
| 44 | + python=${{matrix.python-version}} |
| 45 | + - name: Install wradlib |
| 46 | + run: | |
| 47 | + git clone https://github.com/wradlib/wradlib.git |
| 48 | + cd wradlib |
| 49 | + echo "WRADLIB_TAG=`git name-rev --name-only --tags HEAD`" >> $GITHUB_ENV |
| 50 | + python -m pip install . --no-deps |
| 51 | + - name: Install wradlib-data |
| 52 | + run: | |
| 53 | + python -m pip install git+https://github.com/wradlib/wradlib-data@pooch |
| 54 | + mkdir ./wradlib-data |
| 55 | + - name: Version Info |
| 56 | + run: | |
| 57 | + python -c "import wradlib; print(wradlib.version.version)" |
| 58 | + python -c "import wradlib; print(wradlib.show_versions())" |
| 59 | + - name: Render with pytest |
| 60 | + run: | |
| 61 | + export WRADLIB_DATA=`realpath $WRADLIB_DATA` |
| 62 | + pytest -n auto --verbose --durations=15 --pyargs notebooks |
| 63 | + - name: Commit files |
| 64 | + if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' |
| 65 | + run: | |
| 66 | + git config --global user.email "[email protected]" |
| 67 | + git config --global user.name "wradlib-docs-bot" |
| 68 | + git checkout --orphan render |
| 69 | + git add --all . |
| 70 | + git commit -m "Rendering at commit $GITHUB_SHA" |
| 71 | + - name: Push changes |
| 72 | + if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' |
| 73 | + run: | |
| 74 | + if [ $WRADLIB_TAG == 'undefined' ]; then |
| 75 | + BRANCH=devel |
| 76 | + else |
| 77 | + BRANCH=$WRADLIB_TAG |
| 78 | + fi |
| 79 | + git push https://${{ secrets.GITHUB_TOKEN }}@github.com/wradlib/wradlib-notebooks.git render:$BRANCH -fq |
| 80 | +
|
| 81 | + build_1: |
| 82 | + name: wradlib notebooks - macosx |
| 83 | + runs-on: macos-latest |
| 84 | + defaults: |
| 85 | + run: |
| 86 | + shell: bash -l {0} |
| 87 | + env: |
| 88 | + WRADLIB_DATA: ./wradlib-data |
| 89 | + CONDA_ENV_FILE: ci/requirements/notebooks.yml |
| 90 | + strategy: |
| 91 | + fail-fast: false |
| 92 | + matrix: |
| 93 | + python-version: ["3.11"] |
| 94 | + steps: |
| 95 | + - uses: actions/checkout@v3 |
| 96 | + with: |
| 97 | + fetch-depth: 0 |
| 98 | + - name: Install micromamba environment |
| 99 | + uses: mamba-org/setup-micromamba@v1 |
| 100 | + with: |
| 101 | + environment-name: wradlib-notebooks |
| 102 | + environment-file: ${{env.CONDA_ENV_FILE}} |
| 103 | + cache-environment: true |
| 104 | + cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}" |
| 105 | + create-args: >- |
| 106 | + python=${{matrix.python-version}} |
| 107 | + - name: Install wradlib |
| 108 | + run: | |
| 109 | + git clone https://github.com/wradlib/wradlib.git |
| 110 | + cd wradlib |
| 111 | + echo "WRADLIB_TAG=`git name-rev --name-only --tags HEAD`" >> $GITHUB_ENV |
| 112 | + python -m pip install . --no-deps |
| 113 | + - name: Install wradlib-data |
| 114 | + run: | |
| 115 | + python -m pip install git+https://github.com/wradlib/wradlib-data@pooch |
| 116 | + mkdir ./wradlib-data |
| 117 | + - name: Version Info |
| 118 | + run: | |
| 119 | + python -c "import wradlib; print(wradlib.version.version)" |
| 120 | + python -c "import wradlib; print(wradlib.show_versions())" |
| 121 | + - name: Render with pytest |
| 122 | + run: | |
| 123 | + export WRADLIB_DATA=`python -c "import os, sys; print(os.path.realpath(sys.argv[1]))" $WRADLIB_DATA` |
| 124 | + pytest -n auto --verbose --durations=15 --pyargs notebooks |
| 125 | + build_2: |
| 126 | + name: wradlib notebooks - windows |
| 127 | + runs-on: windows-latest |
| 128 | + defaults: |
| 129 | + run: |
| 130 | + shell: bash -l {0} |
| 131 | + env: |
| 132 | + WRADLIB_DATA: ./wradlib-data |
| 133 | + CONDA_ENV_FILE: ci/requirements/notebooks.yml |
| 134 | + strategy: |
| 135 | + fail-fast: false |
| 136 | + matrix: |
| 137 | + python-version: ["3.11"] |
| 138 | + steps: |
| 139 | + - uses: actions/checkout@v3 |
| 140 | + with: |
| 141 | + fetch-depth: 0 |
| 142 | + - name: Install micromamba environment |
| 143 | + uses: mamba-org/setup-micromamba@v1 |
| 144 | + with: |
| 145 | + environment-name: wradlib-notebooks |
| 146 | + environment-file: ${{env.CONDA_ENV_FILE}} |
| 147 | + cache-environment: true |
| 148 | + cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}" |
| 149 | + create-args: >- |
| 150 | + python=${{matrix.python-version}} |
| 151 | + - name: Install wradlib |
| 152 | + run: | |
| 153 | + git clone https://github.com/wradlib/wradlib.git |
| 154 | + cd wradlib |
| 155 | + python -m pip install . --no-deps |
| 156 | + - name: Install wradlib-data |
| 157 | + run: | |
| 158 | + python -m pip install git+https://github.com/wradlib/wradlib-data@pooch |
| 159 | + mkdir ./wradlib-data |
| 160 | + - name: Version Info |
| 161 | + run: | |
| 162 | + python -c "import wradlib; print(wradlib.version.version)" |
| 163 | + python -c "import wradlib; print(wradlib.show_versions())" |
| 164 | + - name: Test with pytest |
| 165 | + run: | |
| 166 | + export WRADLIB_DATA=`python -c "import os, sys; print(os.path.realpath(sys.argv[1]))" $WRADLIB_DATA` |
| 167 | + pytest -n auto --verbose --durations=15 --pyargs notebooks |
| 168 | +
|
| 169 | + trigger_rtd: |
| 170 | + if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' |
| 171 | + needs: [build_0] |
| 172 | + name: trigger readthedocs |
| 173 | + runs-on: ubuntu-latest |
| 174 | + defaults: |
| 175 | + run: |
| 176 | + shell: bash -l {0} |
| 177 | + env: |
| 178 | + RTD_TOKEN: ${{ secrets.RTD_TOKEN }} |
| 179 | + RTD_URL: ${{ secrets.RTD_URL }} |
| 180 | + steps: |
| 181 | + - name: trigger readthedocs |
| 182 | + run: | |
| 183 | + echo "triggering" |
| 184 | + curl -X POST -d "token=$RTD_TOKEN" "$RTD_URL" |
0 commit comments