-
Notifications
You must be signed in to change notification settings - Fork 0
559 lines (506 loc) · 19.2 KB
/
self_hosted_tests.yml
File metadata and controls
559 lines (506 loc) · 19.2 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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
# Copyright (c) 2020 The University of Manchester
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# This workflow will install Python dependencies, run tests, lint and rat with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Self Hosted Tests
on:
push:
schedule:
- cron: '0 1 * * 0,6'
- cron: '0 1 * * 1-5'
jobs:
integration_tests:
runs-on: self-hosted
# 24 * 60 minutes
timeout-minutes: 1440
container:
image: localhost:5000/python3.13:latest
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v5
with:
token: ${{ secrets.SPINNAKER_PAT }}
- name: 'Setup jq'
id: setup-jq
uses: dcarbone/install-jq-action@v3
- name: Install Python Dependencies
id: python-install
run: |
pip install virtualenv
virtualenv pyenv
source pyenv/bin/activate
pip install --upgrade setuptools wheel
pip install --upgrade pip
- name: Setup Environment
shell: bash
run: |
echo "SPINN_INSTALL_DIR=${GITHUB_WORKSPACE}/spinnaker_tools_install" >> $GITHUB_ENV
echo "SPINN_COMMON_INSTALL_DIR=${GITHUB_WORKSPACE}/spinn_common_install" >> $GITHUB_ENV
echo "FEC_INSTALL_DIR=${GITHUB_WORKSPACE}/fec_install" >> $GITHUB_ENV
echo "SPYNNAKER_INSTALL_DIR=${GITHUB_WORKSPACE}/spynnaker_install" >> $GITHUB_ENV
echo "GLOBAL_REPORTS=${GITHUB_WORKSPACE}/global_reports" >> $GITHUB_ENV
echo "SPALLOC_USER=${{ secrets.SPALLOC_USER }}" >> $GITHUB_ENV
echo "SPALLOC_PASSWORD=${{ secrets.SPALLOC_PASSWORD }}" >> $GITHUB_ENV
id: set_env_step
- name: Clone Repositories to be tested
id: clone-repos
uses: ./.github/actions/clone_matching
with:
repository: |
https://github.com/SpiNNakerManchester/SpiNNUtils.git
https://github.com/SpiNNakerManchester/SpiNNMachine.git
https://github.com/SpiNNakerManchester/SpiNNMan.git
https://github.com/SpiNNakerManchester/PACMAN.git
https://github.com/SpiNNakerManchester/spalloc.git
https://github.com/SpiNNakerManchester/SpiNNakerGraphFrontEnd.git
https://github.com/SpiNNakerManchester/spinnaker_tools.git
https://github.com/SpiNNakerManchester/spinn_common.git
https://github.com/SpiNNakerManchester/SpiNNFrontEndCommon.git
https://github.com/SpiNNakerManchester/sPyNNaker.git
https://github.com/SpiNNakerManchester/Visualiser.git
https://github.com/SpiNNakerManchester/JavaSpiNNaker.git
https://github.com/SpiNNakerManchester/PyNNExamples.git
https://github.com/SpiNNakerManchester/sPyNNakerNewModelTemplate.git
https://github.com/SpiNNakerManchester/microcircuit_model.git
https://github.com/SpiNNakerManchester/SpiNNGym.git
https://github.com/SpiNNakerManchester/MarkovChainMonteCarlo.git
https://github.com/SpiNNakerManchester/TestBase.git
https://github.com/SpiNNakerManchester/SpiNNaker_PDP2.git
https://github.com/SpiNNakerManchester/SpiNNakerJupyterExamples.git
https://${{ secrets.SPINNAKER_PAT }}@github.com/SpiNNakerManchester/TSPonSpiNNaker.git
- name: Setup SpiNNUtils
id: setup-spinnutils
run: |
source pyenv/bin/activate
pip install ./SpiNNUtils[test]
- name: Make C Code
id: make-c-code
run: |
source pyenv/bin/activate
make -C spinnaker_tools install
make -C spinn_common install
make -C SpiNNFrontEndCommon/c_common install
make -C sPyNNaker/neural_modelling install
make -C sPyNNakerNewModelTemplate/c_models
make -C SpiNNakerGraphFrontEnd/gfe_examples
make -C SpiNNakerGraphFrontEnd/gfe_integration_tests
make -C SpiNNGym/c_code
make -C MarkovChainMonteCarlo/c_models
make -C SpiNNaker_PDP2/c_code
make -C Visualiser
make -C TSPonSpiNNaker/spinnaker_c
- name: Install Python Modules
id: install-python-modules
run: |
source pyenv/bin/activate
pip install ./SpiNNMachine[test]
pip install ./SpiNNMan[test]
pip install ./PACMAN[test]
pip install ./spalloc[test]
pip install ./SpiNNFrontEndCommon[test]
pip install ./TestBase[test]
pip install ./sPyNNaker[test]
pip install ./sPyNNakerNewModelTemplate[test]
pip install ./SpiNNakerGraphFrontEnd[test]
pip install ./SpiNNGym[test]
pip install ./MarkovChainMonteCarlo[test]
# Due to the binaries being outside of the package
pip install -e ./SpiNNaker_PDP2[test]
pip install ./Visualiser[test]
pip install ./TSPonSpiNNaker[test]
# no install SpiNNakerJupyterExamples
python -m spynnaker.pyNN.setup_pynn
# Additional requirements for testing here
# coverage version capped due to https://github.com/nedbat/coveragepy/issues/883
pip install pytest!=9.0.0
pip install nbmake python-coveralls "coverage>=5.0.0" pytest-instafail pytest-xdist pytest-progress pytest-forked pytest-timeout
pip freeze
- name: Install Java
id: install-java
run: |
java -version
mvn -version
mvn package -B -f JavaSpiNNaker -pl -SpiNNaker-allocserv -DskipTests
- name: Delete Install Sources
id: delete-install-sources
run: |
rm -rf spinn_common
rm -rf SpiNNUtils/spinn_utilities
rm -rf SpiNNUtils/build
rm -rf SpiNNMachine/spinn_machine
rm -rf SpiNNMachine/build
rm -rf SpiNNMan/spinnman
rm -rf SpiNNMan/build
rm -rf PACMAN/pacman
rm -rf PACMAN/pacman_test_objects
rm -rf PACMAN/build
rm -rf spalloc/spalloc_client
rm -rf spalloc/build
rm -rf SpiNNFrontEndCommon/spinn_front_end_common
rm -rf SpiNNFrontEndCommon/c_common
rm -rf SpiNNFrontEndCommon/build
rm -rf TestBase/spinnaker_testbase
rm -rf TestBase/build
rm -rf sPyNNaker/spynnaker
rm -rf sPyNNaker/neural_modelling
rm -rf sPyNNaker/build
rm -rf sPyNNakerNewModelTemplate/python_models
rm -rf sPyNNakerNewModelTemplate/build
rm -rf SpiNNakerGraphFrontEnd/spinnaker_graph_front_end
rm -rf SpiNNakerGraphFrontEnd/build
rm -rf SpiNNGym/spinn_gym
rm -rf SpiNNGym/c_code
rm -rf SpiNNGym/build
rm -rf MarkovChainMonteCarlo/mcmc
rm -rf MarkovChainMonteCarlo/build
# Due to the binaries being outside of the package
# NO remove SpiNNaker_PDP2
rm -rf Visualiser/visualiser_example_binaries
rm -rf Visualiser/build
# No remove SpiNNakerJupyterExamples
rm -rf TSPonSpiNNaker/spinnaker_c
rm -rf TSPonSpiNNaker/build
rm -rf TSPonSpiNNaker/binaries
# --------------------------------------------------------------------
- name: Run SpiNNUtils Unit Tests
id: spinnutils-unit-tests
uses: ./.github/actions/pytest_local
with:
tests: SpiNNUtils/unittests
timeout: 1200
results: SpiNNUtils
covfile: unit
n_threads: auto
- name: Run SpiNNMachine Unit Tests
id: spinnmachine-unit-tests
uses: ./.github/actions/pytest_local
with:
tests: SpiNNMachine/unittests
timeout: 1200
results: SpiNNMachine
covfile: unit
n_threads: auto
- name: Run SpiNNMan Unit Tests
id: spinnman-unit-tests
uses: ./.github/actions/pytest_local
with:
tests: SpiNNMan/unittests
timeout: 1200
results: SpiNNMan
covfile: unit
n_threads: auto
- name: Run SpiNNMan Integration Tests
id: spinnman-integration-tests
uses: ./.github/actions/pytest_local
with:
tests: SpiNNMan/spinnman_integration_tests
timeout: 1200
results: SpiNNMan
covfile: unit
n_threads: auto
- name: Run PACMAN Unit Tests
id: pacman-unit-tests
uses: ./.github/actions/pytest_local
with:
tests: PACMAN/unittests
timeout: 1200
results: PACMAN
covfile: unit
n_threads: auto
- name: Run spalloc Unit Tests
id: spalloc-unit-tests
uses: ./.github/actions/pytest_local
with:
tests: spalloc/tests
timeout: 1200
results: spalloc
covfile: unit
n_threads: 1
- name: Run SpiNNFrontEndCommon Unit Tests
id: fec-unit-tests
uses: ./.github/actions/pytest_local
with:
tests: SpiNNFrontEndCommon/unittests
timeout: 1200
results: SpiNNFrontEndCommon
covfile: unit
n_threads: auto
- name: Run SpiNNFrontEndCommon Integration Tests
id: fec-integration-tests
uses: ./.github/actions/pytest_local
with:
tests: SpiNNFrontEndCommon/fec_integration_tests
timeout: 1200
results: SpiNNFrontEndCommon
covfile: unit
n_threads: auto
- name: Run sPyNNaker Unit Tests
id: spynnaker-unit-tests
uses: ./.github/actions/pytest_local
with:
tests: sPyNNaker/unittests
timeout: 1200
results: sPyNNaker
covfile: unit
n_threads: auto
- name: Run SpiNNakerGraphFrontEnd Unit Tests
id: gfe-unit-tests
uses: ./.github/actions/pytest_local
with:
tests: SpiNNakerGraphFrontEnd/unittests
timeout: 1200
results: SpiNNakerGraphFrontEnd
covfile: unit
n_threads: auto
- name: Run PyNNExamples Unit Tests
id: pynn-examples-unit-tests
uses: ./.github/actions/pytest_local
with:
tests: PyNNExamples/unittests
timeout: 1200
results: PyNNExamples
covfile: unit
n_threads: auto
- name: Run SpiNNGym Unit Tests
id: spinn-gym-unit-tests
uses: ./.github/actions/pytest_local
with:
tests: SpiNNGym/unittests
timeout: 1200
results: SpiNNGym
covfile: unit
n_threads: auto
- name: Run MarkovChainMonteCarlo Unit Tests
id: mcmc-unit-tests
uses: ./.github/actions/pytest_local
with:
tests: MarkovChainMonteCarlo/unittests
timeout: 1200
results: MarkovChainMonteCarlo
covfile: unit
n_threads: auto
- name: Run SpiNNaker_PDP2 Unit Tests
id: pdp2-unit-tests
uses: ./.github/actions/pytest_local
with:
tests: SpiNNaker_PDP2/unittests
timeout: 1200
results: SpiNNaker_PDP2
covfile: unit
n_threads: auto
- name: Run TSPonSpiNNaker Unit Tests
id: tsp-on-spinnaker-unit-tests
uses: ./.github/actions/pytest_local
with:
tests: TSPonSpiNNaker/unittests
timeout: 1200
results: TSPonSpiNNaker
covfile: unit
n_threads: auto
# --------------------------------------------------------------------
- name: Refresh test runner scripts
id: refresh-runner-scripts
run: |
source pyenv/bin/activate
python SpiNNakerGraphFrontEnd/gfe_integration_tests/script_builder.py
python PyNNExamples/integration_tests/script_builder.py
python sPyNNakerNewModelTemplate/nmt_integration_tests/script_builder.py
python SpiNNGym/integration_tests/script_builder.py
python MarkovChainMonteCarlo/mcmc_integration_tests/script_builder.py
python SpiNNaker_PDP2/integration_tests/script_builder.py
python TSPonSpiNNaker/integration_tests/script_builder.py
- name: Check previous
id: test-previous
if: always()
env:
STEPS_CONTEXT: ${{ toJson(steps) }}
run: |
export failed_steps=$(echo "$STEPS_CONTEXT" | jq -r 'keys[] as $k | select(.[$k].outcome=="failure") | "\($k): \(.[$k].outcome)"')
echo "$failed_steps"
if echo "$failed_steps" | grep -q "failure"; then
echo "prev_ok=false" >> $GITHUB_OUTPUT
echo "fail"
else
echo "prev_ok=true" >> $GITHUB_OUTPUT
echo "pass"
fi
# --------------------------------------------------------------------
- name: Run sPyNNaker Integration Tests
id: spynnaker-integration-tests
if: always() && steps.test-previous.outputs.prev_ok == 'true'
uses: ./.github/actions/pytest_local
with:
tests: sPyNNaker/spynnaker_integration_tests
timeout: 24000
results: sPyNNaker_Integration_Tests
covfile: integration
n_threads: auto
- name: Run GFE Integration Tests
id: gfe-integration-tests
if: always() && steps.test-previous.outputs.prev_ok == 'true'
uses: ./.github/actions/pytest_local
with:
tests: SpiNNakerGraphFrontEnd/gfe_integration_tests/
timeout: 3600
results: GFE_Integration
covfile: integration
n_threads: auto
- name: Run PyNNExamples Integration Tests
id: pynn-examples-integration-tests
if: always() && steps.test-previous.outputs.prev_ok == 'true'
uses: ./.github/actions/pytest_local
with:
tests: PyNNExamples/integration_tests/
timeout: 3600
results: PyNNExamples_Integration
covfile: integration
n_threads: auto
- name: Run sPyNNakerNewModelTemplate Integration Tests
id: spynnaker-new-model-template-integration-tests
if: always() && steps.test-previous.outputs.prev_ok == 'true'
uses: ./.github/actions/pytest_local
with:
tests: sPyNNakerNewModelTemplate/nmt_integration_tests/
timeout: 3600
results: sPyNNakerNewModelTemplate_Integration
covfile: integration
n_threads: auto
- name: Run microcircuit_model Integration Tests
id: microcircuit-model-integration-tests
if: always() && steps.test-previous.outputs.prev_ok == 'true'
uses: ./.github/actions/pytest_local
with:
tests: microcircuit_model/integration_tests/
timeout: 12000
results: microcircuit_model_Integration
covfile: integration
n_threads: auto
- name: Run SpiNNGym Integration Tests
id: spinn-gym-integration-tests
if: always() && steps.test-previous.outputs.prev_ok == 'true'
uses: ./.github/actions/pytest_local
with:
tests: SpiNNGym/integration_tests/
timeout: 3600
results: SpiNNGym_Integration
covfile: integration
n_threads: auto
- name: Run MarkovChainMonteCarlo Integration Tests
id: markov-chain-monte-carlo-integration-tests
if: always() && steps.test-previous.outputs.prev_ok == 'true'
uses: ./.github/actions/pytest_local
with:
tests: MarkovChainMonteCarlo/mcmc_integration_tests/
timeout: 3600
results: MarkovChainMonteCarlo_Integration
covfile: integration
n_threads: auto
- name: Run SpiNNaker_PDP2 Integration Tests
id: spinnaker-pdp2-integration-tests
if: always() && steps.test-previous.outputs.prev_ok == 'true'
uses: ./.github/actions/pytest_local
with:
tests: SpiNNaker_PDP2/integration_tests/
timeout: 3600
results: SpiNNaker_PDP2_Integration
covfile: integration
n_threads: auto
- name: Run Visualiser Integration Tests
id: visualiser-integration-tests
if: always() && steps.test-previous.outputs.prev_ok == 'true'
uses: ./.github/actions/pytest_local
with:
tests: Visualiser/visualiser_integration_tests/
timeout: 3600
results: Visualiser_Integration
covfile: integration
n_threads: auto
- name: Run SpiNNakerJupyterExamples
id: spinnaker-jupyter-examples
if: always() && steps.test-previous.outputs.prev_ok == 'true'
run: |
source pyenv/bin/activate
pytest -n auto --nbmake SpiNNakerJupyterExamples/**/*.ipynb SpiNNakerJupyterExamples/**/**/*.ipynb
- name: Run TSPOnSpiNNaker Integration Tests
id: tsp-on-spinnaker-integration-tests
if: always() && steps.test-previous.outputs.prev_ok == 'true'
uses: ./.github/actions/pytest_local
with:
tests: TSPonSpiNNaker/integration_tests/
timeout: 3600
results: TSPOnSpiNNaker_Integration
covfile: integration
n_threads: auto
- name: Run Whole Board Test
id: whole_board_test
# Only weekends
if: github.event.schedule == '0 1 * * 0,6'
uses: ./.github/actions/pytest_local
with:
tests: sPyNNaker/test_whole_board
# 20 * 60 * 60 seconds
timeout: 72000
results: sPyNNaker_whole_board
covfile: integration
n_threads: auto
# --------------------------------------------------------------------
- name: Check Reports
if: always() && steps.test-previous.outputs.prev_ok == 'true'
run: |
source pyenv/bin/activate
python -m spinn_utilities.executable_finder
find ${GLOBAL_REPORTS} -print -exec cat \{\} \;
- name: Check Destroyed
if: always() && steps.test-previous.outputs.prev_ok == 'true'
run: |
source pyenv/bin/activate
python -m spinnaker_testbase.test_no_job_destroy
- name: Extract branch name
shell: bash
if: always() && steps.test-previous.outputs.prev_ok == 'true'
run: |
echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
id: extract_branch
- name: Create Coverage HTML
if: always() && steps.test-previous.outputs.prev_ok == 'true'
run: |
source pyenv/bin/activate
coverage html -d ${GITHUB_WORKSPACE}/coverage_html
- name: Checkout Pages
uses: actions/checkout@v5
if: always() && steps.test-previous.outputs.prev_ok == 'true'
with:
ref: gh-pages
path: ghpagesupdate
token: ${{ secrets.SPINNAKER_PAT }}
- name: Copy coverage for branch
if: always() && steps.test-previous.outputs.prev_ok == 'true'
run: |
rm -rf ghpagesupdate/${{ steps.extract_branch.outputs.branch }}
mkdir -p ghpagesupdate/${{ steps.extract_branch.outputs.branch }}
cp -a ./coverage_html/* ghpagesupdate/${{ steps.extract_branch.outputs.branch }}/
- name: Push Coverage to GitHub Pages
if: always() && steps.test-previous.outputs.prev_ok == 'true'
env:
GH_TOKEN: ${{ secrets.SPINNAKER_PAT }}
working-directory: ghpagesupdate
run: |
git config --global user.email "no-reply@github.com"
git config --global user.name "GitHub Actions"
git add -A
git commit -a -m "Update Coverage"
git push origin gh-pages
echo "::notice::Coverage information deployed to https://spinnakermanchester.github.io/IntegrationTests/${{ steps.extract_branch.outputs.branch }}/"