forked from AstarVienna/irdb
-
Notifications
You must be signed in to change notification settings - Fork 0
162 lines (151 loc) · 5.94 KB
/
notebooktests.yml
File metadata and controls
162 lines (151 loc) · 5.94 KB
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
# Needs to be called from elsewhere or triggered manually.
# This allows for running the IRDB notebooks for any new branch in ScopeSim
# or ScopeSim_Templates, without the need for a corresponding IRDB branch if
# that's not required anyway.
# Note: If no options are passed, this installs ScopeSim and Templates from
# the main branch in either repo.
name: Notebook Tests
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
from_pypi:
type: boolean
description: "Use plain pip install and ignore branch names below."
required: false
default: false
ScopeSim:
type: string
description: "Branch name to install ScopeSim from."
required: false
default: main
ScopeSim_Templates:
type: string
description: "Branch name to install ScopeSim_Templates from."
required: false
default: main
# Allow this workflow to be called from other repositories.
workflow_call:
inputs:
from_pypi:
type: boolean
description: "Use plain pip install and ignore branch names below."
required: false
default: false
ScopeSim:
type: string
description: "Branch name to install ScopeSim from."
required: false
default: main
ScopeSim_Templates:
type: string
description: "Branch name to install ScopeSim_Templates from."
required: false
default: main
jobs:
micado_notebooks:
name: Run MICADO Notebooks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
# No matrix is used since this is a time-consuming task.
python-version: 3.13
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.github_actions.txt
- name: Install ScopeSim from repo
if: ${{ inputs.from_pypi == false || inputs.from_pypi == 'false' }}
run: |
echo "Re-installing ScopeSim from source" >> $GITHUB_STEP_SUMMARY
pip uninstall -y scopesim scopesim_templates
pip install git+https://github.com/AstarVienna/ScopeSim.git@${{ inputs.ScopeSim }}
pip install git+https://github.com/AstarVienna/ScopeSim_Templates.git@${{ inputs.ScopeSim_Templates }}
- name: Run Notebooks
env:
PYDEVD_DISABLE_FILE_VALIDATION: 1
run: |
echo "## MICADO Notebooks tested" >> $GITHUB_STEP_SUMMARY
sed -i "s/USE_FULL_DETECTOR = True/USE_FULL_DETECTOR = False/g" MICADO/docs/example_notebooks/*.ipynb
sed -i 's/# cmd\[\\"!SIM.spectral.spectral_bin_width/cmd\[\\"!SIM.spectral.spectral_bin_width/g' MICADO/docs/example_notebooks/*.ipynb
for fn in MICADO/docs/example_notebooks/*.ipynb
do
echo "${fn}"
echo "- ${fn}" >> $GITHUB_STEP_SUMMARY
/usr/bin/time -v jupytext --execute --update "${fn}"
done
mosaic_notebooks:
name: Run MOSAIC Notebooks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
# No matrix is used since this is a time-consuming task.
python-version: 3.13
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.github_actions.txt
- name: Install ScopeSim from repo
if: ${{ inputs.from_pypi == false || inputs.from_pypi == 'false' }}
run: |
echo "Re-installing ScopeSim from source" >> $GITHUB_STEP_SUMMARY
pip uninstall -y scopesim scopesim_templates
pip install git+https://github.com/AstarVienna/ScopeSim.git@${{ inputs.ScopeSim }}
pip install git+https://github.com/AstarVienna/ScopeSim_Templates.git@${{ inputs.ScopeSim_Templates }}
- name: Run Notebooks
env:
PYDEVD_DISABLE_FILE_VALIDATION: 1
run: |
echo "## MOSAIC Notebooks tested" >> $GITHUB_STEP_SUMMARY
for fn in MOSAIC/docs/example_notebooks/*.ipynb
do
echo "${fn}"
echo "- ${fn}" >> $GITHUB_STEP_SUMMARY
/usr/bin/time -v jupytext --execute --update "${fn}"
done
metis_notebooks:
name: Run METIS Notebooks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
# No matrix is used since this is a time-consuming task.
python-version: 3.13
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.github_actions.txt
- name: Install ScopeSim from repo
if: ${{ inputs.from_pypi == false || inputs.from_pypi == 'false' }}
run: |
echo "Re-installing ScopeSim from source" >> $GITHUB_STEP_SUMMARY
pip uninstall -y scopesim scopesim_templates
pip install git+https://github.com/AstarVienna/ScopeSim.git@${{ inputs.ScopeSim }}
pip install git+https://github.com/AstarVienna/ScopeSim_Templates.git@${{ inputs.ScopeSim_Templates }}
- name: Run Notebooks
env:
PYDEVD_DISABLE_FILE_VALIDATION: 1
run: |
echo "## METIS Notebooks tested" >> $GITHUB_STEP_SUMMARY
echo "### Example Notebooks" >> $GITHUB_STEP_SUMMARY
for fn in METIS/docs/example_notebooks/*.ipynb
do
echo "${fn}"
echo "- ${fn}" >> $GITHUB_STEP_SUMMARY
/usr/bin/time -v jupytext --execute --update "${fn}"
done
echo "## Demo Notebooks" >> $GITHUB_STEP_SUMMARY
for fn in METIS/docs/example_notebooks/demos/*.ipynb
do
echo "${fn}"
echo "- ${fn}" >> $GITHUB_STEP_SUMMARY
/usr/bin/time -v jupytext --execute --update "${fn}"
done