-
Notifications
You must be signed in to change notification settings - Fork 1
212 lines (196 loc) · 7.37 KB
/
v2dl3-eventdisplay.yml
File metadata and controls
212 lines (196 loc) · 7.37 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
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
211
212
---
name: v2dl3-Eventdisplay-CI
on:
pull_request:
paths-ignore:
- 'utils/**vegas**'
- '.github/v2dl3-vegas.yml'
- '.git*'
- 'CITATION.cff'
- 'environment-vegas.yml'
- 'LICENSE'
- 'README.md'
- 'setup.py'
workflow_dispatch:
inputs:
generate_reference:
description: 'Generate reference files instead of testing'
required: false
default: false
type: boolean
env:
GENERATE_REFERENCE: ${{ github.event.inputs.generate_reference || false }}
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.13"]
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Pip install
run: |
pip install .[tests]
- name: pytest
shell: bash -leo pipefail {0}
run: |
pytest .
- name: Cache test data
id: cache-test-data
uses: actions/cache@v5
with:
path: |
64080.anasum.root
effectiveArea.root
64080.db.fits.gz
64080.allevents.anasum.root
eventfilter.yml
ED-*.fits.gz
key: eventdisplay-test-data-v1
- name: Download test data
if: steps.cache-test-data.outputs.cache-hit != 'true'
env:
TEST_DATA_URL: ${{ secrets.EVENTDISPLAY_TEST_DATA_URL }}
run: |
if [ -z "$TEST_DATA_URL" ]; then
echo "Error: EVENTDISPLAY_TEST_DATA_URL secret not set"
exit 1
fi
wget --no-verbose "$TEST_DATA_URL" -O github-CI.tar.gz
tar -xvzf github-CI.tar.gz
rm github-CI.tar.gz
- name: Eventdisplay-pointlike
continue-on-error: ${{ env.GENERATE_REFERENCE == 'true' }}
shell: bash -leo pipefail {0}
run: |
# point-like tests
v2dl3-eventdisplay \
-f ./64080.anasum.root \
./effectiveArea.root \
--logfile test-pointlike.fits.log \
test-pointlike-CI.fits.gz
if [ "$GENERATE_REFERENCE" != "true" ]; then
v2dl3-compareFitsFiles \
-f ED-pointlike-CI.fits.gz test-pointlike-CI.fits.gz \
-d test-pointlike.log
cat test-pointlike.log
grep -q "No differences found" test-pointlike.log
else
mv test-pointlike-CI.fits.gz ED-pointlike-CI.fits.gz
mv test-pointlike.fits.log ED-pointlike-CI.log
fi
- name: Eventdisplay-full-enclosure
continue-on-error: ${{ env.GENERATE_REFERENCE == 'true' }}
shell: bash -leo pipefail {0}
env:
PYTHONPATH: .
run: |
# full-enclosure tests
v2dl3-eventdisplay --full-enclosure \
-f ./64080.anasum.root \
./effectiveArea.root \
--logfile test-full-enclosure.fits.log \
test-full-enclosure-CI.fits.gz
if [ "$GENERATE_REFERENCE" != "true" ]; then
v2dl3-compareFitsFiles \
-f ED-fullenclosure-CI.fits.gz test-full-enclosure-CI.fits.gz \
-d test-full-enclosure.log
cat test-full-enclosure.log
grep -q "No differences found" test-full-enclosure.log
else
mv test-full-enclosure-CI.fits.gz ED-fullenclosure-CI.fits.gz
mv test-full-enclosure.fits.log ED-fullenclosure-CI.log
fi
- name: Eventdisplay-pointlike-DB
continue-on-error: ${{ env.GENERATE_REFERENCE == 'true' }}
shell: bash -leo pipefail {0}
env:
PYTHONPATH: .
run: |
# point-like tests (with DB)
v2dl3-eventdisplay \
-f ./64080.anasum.root \
./effectiveArea.root \
--db_fits_file ./64080.db.fits.gz \
--logfile test-pointlike-db.fits.log \
test-pointlike-db-CI.fits.gz
if [ "$GENERATE_REFERENCE" != "true" ]; then
v2dl3-compareFitsFiles \
-f ED-pointlike-db-CI.fits.gz test-pointlike-db-CI.fits.gz \
-d test-pointlike-db.log
cat test-pointlike-db.log
grep -q "No differences found" test-pointlike-db.log
else
mv test-pointlike-db-CI.fits.gz ED-pointlike-db-CI.fits.gz
mv test-pointlike-db.fits.log ED-pointlike-db-CI.log
fi
- name: Eventdisplay-pointlike-select
continue-on-error: ${{ env.GENERATE_REFERENCE == 'true' }}
shell: bash -leo pipefail {0}
env:
PYTHONPATH: .
run: |
# point-like tests with event selection
v2dl3-eventdisplay \
-f ./64080.allevents.anasum.root \
./effectiveArea.root \
--evt_filter eventfilter.yml \
--logfile test-pointlike-all.fits.log \
test-pointlike-all-CI.fits.gz
if [ "$GENERATE_REFERENCE" != "true" ]; then
v2dl3-compareFitsFiles \
-f ED-pointlike-all-CI.fits.gz test-pointlike-all-CI.fits.gz \
-d test-pointlike-all.log
cat test-pointlike-all.log
grep -q "No differences found" test-pointlike-all.log
else
mv test-pointlike-all-CI.fits.gz ED-pointlike-all-CI.fits.gz
mv test-pointlike-all.fits.log ED-pointlike-all-CI.log
fi
- name: Eventdisplay-full-enclosure-select
continue-on-error: ${{ env.GENERATE_REFERENCE == 'true' }}
shell: bash -leo pipefail {0}
env:
PYTHONPATH: .
run: |
# full-enclosure tests with event selection
v2dl3-eventdisplay --full-enclosure \
-f ./64080.allevents.anasum.root \
./effectiveArea.root \
--evt_filter eventfilter.yml \
--logfile test-full-enclosure-all.fits.log \
test-full-enclosure-all-CI.fits.gz
if [ "$GENERATE_REFERENCE" != "true" ]; then
v2dl3-compareFitsFiles \
-f ED-full-enclosure-all-CI.fits.gz test-full-enclosure-all-CI.fits.gz \
-d test-full-enclosure-all.log
cat test-full-enclosure-all.log
grep -q "No differences found" test-full-enclosure-all.log
else
mv test-full-enclosure-all-CI.fits.gz ED-full-enclosure-all-CI.fits.gz
mv test-full-enclosure-all.fits.log ED-full-enclosure-all-CI.log
fi
- name: Create reference archive
if: env.GENERATE_REFERENCE == 'true'
run: |
echo "Creating reference archive..."
# Only create archive if at least one file exists
if ls *.root *.gz *.log *.yml 1> /dev/null 2>&1; then
tar -cvzf github-CI.tar.gz *.root *.gz *.log *.yml
echo "Archive created successfully"
else
echo "Warning: No files found to archive" >&2
fi
- name: Upload reference archive
if: env.GENERATE_REFERENCE == 'true'
uses: actions/upload-artifact@v6
with:
name: eventdisplay-reference-archive-python-${{ matrix.python-version }}
path: github-CI.tar.gz
retention-days: 1