-
Notifications
You must be signed in to change notification settings - Fork 35
210 lines (205 loc) · 7.36 KB
/
run_tests.yaml
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
name: Unit tests
on:
push:
pull_request:
workflow_dispatch:
inputs:
python_version:
description: Specify Python version to run tests on
type: string
required: true
default: '3.10'
os:
description: OS to run tests on
type: string
default: ubuntu-latest
workflow_call:
inputs:
python_version:
description: Specify Python version to run tests on
type: string
required: true
default: '3.10'
os:
description: OS to run tests on
type: string
default: ubuntu-latest
env: # set the python_version to 3.10 if the workflow is not triggered by workflow_call or workflow_dispatch
PYTHON_VERSION: ${{ inputs.python_version || '3.10' }}
jobs:
build:
runs-on: ${{ inputs.os || 'ubuntu-latest' }}
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- uses: actions/checkout@v4
- name: Set up Python [${{ env.PYTHON_VERSION }}]
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Cache pip
uses: actions/cache@v4
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('NuRadioMC/test/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install dependencies
run: |
sudo apt-get install libgsl-dev
python -m pip install --upgrade pip
pip install flake8 pytest
export GSLDIR=$(gsl-config --prefix)
python install_dev.py --install --no-interactive
pip uninstall numba -y # easiest way to test ARZ without numba
export PYTHONPATH=$(pwd):$PYTHONPATH
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Lint with flake8 (important)
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Lint with flake8 (unimportant)
run: |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --max-complexity=10 --max-line-length=127 --statistics --exit-zero
- name: "RNO-G Detector"
if: always()
run: |
export PYTHONPATH=$(pwd):$PYTHONPATH
python NuRadioReco/detector/test/test_rnog_detector.py
- name: "detector.Response"
if: always()
run: |
export PYTHONPATH=$(pwd):$PYTHONPATH
python NuRadioReco/detector/test/test_response.py
- name: "RNO-G data reader"
if: always()
run: |
pip install git+https://github.com/RNO-G/mattak.git
export PYTHONPATH=$(pwd):$PYTHONPATH
NuRadioReco/test/RNO_G/test_read_rnog_data.sh
- name: "Single event test (South Pole)"
if: always()
run: |
export GSLDIR=$(gsl-config --prefix)
export PYTHONPATH=$(pwd):$PYTHONPATH
NuRadioMC/test/SingleEvents/test_build.sh
- name: Single event test (Moore's Bay)
if: always()
run: |
export GSLDIR=$(gsl-config --prefix)
export PYTHONPATH=$(pwd):$PYTHONPATH
NuRadioMC/test/SingleEvents/validate_MB.sh
- name: Single event test (ARZ)
if: always()
run: |
export GSLDIR=$(gsl-config --prefix)
export PYTHONPATH=$(pwd):$PYTHONPATH
NuRadioMC/test/SingleEvents/validate_ARZ.sh
- name: Test Numba version of ARZ
if: always()
run: |
export GSLDIR=$(gsl-config --prefix)
export PYTHONPATH=$(pwd):$PYTHONPATH
pip install numba
NuRadioMC/test/SingleEvents/validate_ARZ.sh
- name: Signal generation test
if: always()
run : |
export GSLDIR=$(gsl-config --prefix)
export PYTHONPATH=$(pwd):$PYTHONPATH
NuRadioMC/test/SignalGen/test_build.sh
- name: "Validate separate trigger channels"
if: always()
run: |
export GSLDIR=$(gsl-config --prefix)
export PYTHONPATH=$(pwd):$PYTHONPATH
NuRadioMC/test/SingleEvents/validate_separate_trigger_channels.sh
- name: "Signal propagation tests"
if: always()
run: |
export PYTHONPATH=$PWD:$PYTHONPATH
export GSLDIR=$(gsl-config --prefix)
NuRadioMC/test/SignalProp/run_signal_test.sh
- name: "Test Birefringence"
if: always()
run: |
export PYTHONPATH=$PWD:$PYTHONPATH
export GSLDIR=$(gsl-config --prefix)
NuRadioMC/test/SignalProp/run_birefringence_tests.sh
- name: "Test Veff example"
if: always()
run: |
export GSLDIR=$(gsl-config --prefix)
export PYTHONPATH=$(pwd):$PYTHONPATH
python install_dev.py --dev proposal --no-interactive
NuRadioMC/test/examples/test_veff_example.sh
- name: "Test calibration pulser example"
if: always()
run: |
export GSLDIR=$(gsl-config --prefix)
export PYTHONPATH=$(pwd):$PYTHONPATH
NuRadioMC/test/examples/test_cal_pulser_example.sh
- name: "Test radio emitter pulser example"
if: always()
run: |
export PYTHONPATH=$PWD:$PYTHONPATH
export GSLDIR=$(gsl-config --prefix)
NuRadioMC/test/examples/test_radio_emitting_pulser_example.sh
- name: "Test webinar examples"
if: always()
run: |
export GSLDIR=$(gsl-config --prefix)
export PYTHONPATH=$(pwd):$PYTHONPATH
NuRadioMC/test/examples/test_webinar.sh
- name: "Veff test"
if: always()
run: |
export GSLDIR=$(gsl-config --prefix)
export PYTHONPATH=$(pwd):$PYTHONPATH
NuRadioMC/test/Veff/1e18eV/test_build.sh
- name: "Veff test with noise and phased array"
if: always()
run: |
export GSLDIR=$(gsl-config --prefix)
export PYTHONPATH=$(pwd):$PYTHONPATH
NuRadioMC/test/Veff/1e18eV/test_build_noise.sh
- name: "Atmospheric Aeff test"
if: always()
run: |
export GSLDIR=$(gsl-config --prefix)
export PYTHONPATH=$(pwd):$PYTHONPATH
NuRadioMC/test/atmospheric_Aeff/1e18eV/test_build.sh
- name: "Tiny reconstrucution"
if: always()
run: |
export GSLDIR=$(gsl-config --prefix)
export PYTHONPATH=$(pwd):$PYTHONPATH
NuRadioReco/test/tiny_reconstruction/testTinyReconstruction.sh
- name: "Trigger tests"
if: always()
run: |
export GSLDIR=$(gsl-config --prefix)
export PYTHONPATH=$(pwd):$PYTHONPATH
NuRadioReco/test/trigger_tests/run_trigger_test.sh
- name: "Test channelGalacticNoiseAdder"
if: always()
run: |
export PYTHONPATH=$(pwd):$PYTHONPATH
python install_dev.py --dev galacticnoise --no-interactive
python NuRadioReco/examples/StandAloneScripts/B01galacticnoiseadder.py
- name: "Test all examples"
if: always()
run: |
export GSLDIR=$(gsl-config --prefix)
export PYTHONPATH=$(pwd):$PYTHONPATH
NuRadioReco/test/test_examples.sh
- name: "Test module structure of all modules in NuRadioReco.modules"
if: always()
run: |
export GSLDIR=$(gsl-config --prefix)
export PYTHONPATH=$(pwd):$PYTHONPATH
python NuRadioReco/test/check_modules.py -r