-
Notifications
You must be signed in to change notification settings - Fork 11
64 lines (63 loc) · 2.12 KB
/
ci.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
name: ci
on:
pull_request:
types: [opened, synchronize, reopened, closed]
jobs:
process:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
env:
GAMMAPY_DATA: /home/runner/work/gammapy-recipes/gammapy-recipes/gammapy-datasets
steps:
- name: checkout repo
uses: actions/checkout@v2
- name: create and activate env
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: gammapy-recipes
environment-file: environment.yml
auto-update-conda: true
- id: grabmodifs
uses: trilom/[email protected]
with:
output: ', '
- name: update env and download data
run: |
IFS=', ' read -r -a array <<< "${{ steps.grabmodifs.outputs.files }}"
for file in ${array[@]}; do
if [[ ${file} =~ "recipes/" ]]; then
folder="$(dirname "${file}")"
env="${folder}/env.yml"
fi
done
if [ -n "${folder}" ] && [ -d "${folder}" ]; then
conda env update --name gammapy-recipes --file ${env}
gammapy download datasets
fi
- name: test notebooks
run: |
IFS=', ' read -r -a array <<< "${{ steps.grabmodifs.outputs.files }}"
for file in ${array[@]}; do
if [[ ${file} =~ "recipes/" ]]; then
folder="$(dirname "${file}")"
fi
done
if [ -n "${folder}" ] && [ -d "${folder}" ]; then
python scripts/process.py --src ${folder}
fi
- name: build docs
run: |
rm -Rf docs/_build/html
cd docs && python -m sphinx . _build/html -b html && cd ..
rm -Rf gammapy-datasets
- name: commit changes
uses: stefanzweifel/git-auto-commit-action@v4
if: github.event.pull_request.merged == true
with:
commit_author: GitHub Actions <[email protected]>
commit_message: commit built documentation
branch : master