-
Notifications
You must be signed in to change notification settings - Fork 76
530 lines (489 loc) · 26.1 KB
/
Copy pathfull_coverage.yml
File metadata and controls
530 lines (489 loc) · 26.1 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
name: coverage
on: [workflow_dispatch]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Python 3.12
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install dependencies
env:
MMS_AUTH_U: ${{ secrets.MMS_AUTH_U }}
MMS_AUTH_P: ${{ secrets.MMS_AUTH_P }}
VIRES_TOKEN: ${{ secrets.VIRES_AUTH }}
run: |
python -m venv ../.venv
source ../.venv/bin/activate
python -m pip install --upgrade pip
pip install pdm uv
pdm config use_uv true
pdm install -dG lint -dG test -dG setup --no-default
- name: Lint with flake8
run: |
source ../.venv/bin/activate
flake8 . --exclude '*venv*','build' --count --select=E9,F63,F7,F82 --show-source --statistics --max-line-length=127
flake8 . --exclude '*venv*','build' --count --exit-zero --max-complexity=10 --statistics --max-line-length=127
- name: Lint with ruff
run: |
source ../.venv/bin/activate
ruff check . --select=E9,F63,F7,F82 --statistics
ruff check . --exit-zero --statistics --line-length=127 -- --max-complexity=10
build_wheel:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v5
- name: Set up Python 3.12
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Build wheel
run: |
python -m venv ../.venv
source ../.venv/bin/activate
python -m pip install --upgrade pip
pip install build
python -m build
- name: Upload wheel artifact
uses: actions/upload-artifact@v6
with:
name: dist-wheel
path: dist/*.whl
retention-days: 7
if-no-files-found: error
tests:
runs-on: ubuntu-latest
needs: build_wheel
if: (github.event_name == 'pull_request' && github.base_ref == 'master') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/refactor_projects' || github.ref == 'refs/heads/pyspedas_2_0_dev'
strategy:
fail-fast: false
matrix:
include:
- shard: spdf_themis_etc
shard_script: |
# This set of tests mostly exercises load routines using SPDF and THEMIS servers
# This is good to have in case any tests access MMS data
echo "Setting up credentials for MMS tests"
python -m pyspedas.projects.mms.tests.test_mms_setup
echo "Starting spdf/cdaweb/hapi tests at $(date)"
coverage run -m pyspedas.hapi_tools.tests.test_hapi
echo Starting ace tests at `date`
coverage run -a -m pyspedas.projects.ace.tests.test_ace
echo Starting cluster tests at `date`
coverage run -a -m pyspedas.projects.cluster.tests.test_cluster
echo Starting cluster S3 tests at `date`
coverage run -a -m pyspedas.projects.cluster.tests.test_cluster_uri
echo Starting CDAWeb tests at `date`
coverage run -a -m pyspedas.cdagui_tools.tests.test_cdagui
echo Starting soho tests at `date`
coverage run -a -m pyspedas.projects.soho.tests.test_soho
echo Starting de2 tests at `date`
coverage run -a -m pyspedas.projects.de2.tests.test_de2
echo Starting st5 tests at `date`
coverage run -a -m pyspedas.projects.st5.tests.test_st5
echo Starting lanl tests at `date`
coverage run -a -m pyspedas.projects.lanl.tests.test_lanl
echo Starting cotrans quaternion tests at `date`
coverage run -a -m pyspedas.cotrans_tools.tests.test_quaternions
echo Starting cnofs tests at `date`
coverage run -a -m pyspedas.projects.cnofs.tests.test_cnofs
echo Starting kompsat tests at `date`
coverage run -a -m pyspedas.projects.kompsat.tests.test_kompsat
echo Starting dscovr tests at `date`
coverage run -a -m pyspedas.projects.dscovr.tests.test_dscovr
echo Starting utilities download tests at `date`
coverage run -a -m pyspedas.utilities.tests.test_utilities_download
echo Starting utilities misc tests at `date`
coverage run -a -m pyspedas.utilities.tests.test_utilities_misc
echo Starting tplot wildcard tests at `date`
coverage run -a -m pyspedas.utilities.tests.test_utilities_tplot_wildcard
echo Starting plotting tests at `date`
coverage run -a -m pyspedas.utilities.tests.test_utilities_plot
echo Starting orbit plot tests at `date`
coverage run -a -m pyspedas.utilities.tests.test_utilities_tplotxy
echo Starting utilities time_tests tests at `date`
coverage run -a -m pyspedas.utilities.tests.test_utilities_time
echo Starting utilities libs_tests tests at `date`
coverage run -a -m pyspedas.utilities.tests.test_utilities_libs
echo Starting utilities S3 tests at `date`
coverage run -a -m pyspedas.utilities.tests.test_utilities_download_uri
echo Starting cotrans tests at `date`
coverage run -a -m pyspedas.cotrans_tools.tests.test_cotrans
echo Starting utilities xdegap tests at `date`
coverage run -a -m pyspedas.utilities.tests.test_xdegap
echo Starting utilities tplot_math tests at `date`
coverage run -a -m pyspedas.utilities.tests.test_math
echo Starting cotrans minvar tests at `date`
coverage run -a -m pyspedas.cotrans_tools.tests.test_minvar
echo Starting cotrans fac tests at `date`
coverage run -a -m pyspedas.cotrans_tools.tests.test_fac
echo Starting cotrans lmn tests at `date`
coverage run -a -m pyspedas.cotrans_tools.tests.test_lmn
echo Starting csswe tests at `date`
coverage run -a -m pyspedas.projects.csswe.tests.test_csswe
echo Starting equator_s tests at `date`
coverage run -a -m pyspedas.projects.equator_s.tests.test_equator_s
echo Starting image tests at `date`
coverage run -a -m pyspedas.projects.image.tests.test_image
echo Starting psp tests at `date`
coverage run -a -m pyspedas.projects.psp.tests.test_psp
echo Starting rbsp tests at `date`
coverage run -a -m pyspedas.projects.rbsp.tests.test_rbsp
echo Starting stereo tests at `date`
coverage run -a -m pyspedas.projects.stereo.tests.test_stereo
echo Starting twins tests at `date`
coverage run -a -m pyspedas.projects.twins.tests.test_twins
echo Starting wind tests at `date`
coverage run -a -m pyspedas.projects.wind.tests.test_wind
echo Starting poes tests at `date`
echo "Disk usage mid spdf"
df -h
du -sh "$DATA_ROOT"/* 2>/dev/null || true
echo Starting fast tests at `date`
coverage run -a -m pyspedas.projects.fast.tests.test_fast
echo Starting omni tests at `date`
coverage run -a -m pyspedas.projects.omni.tests.test_omni
echo Starting themis tests at `date`
coverage run -a -m pyspedas.projects.themis.tests.test_themis
echo Starting mica tests at `date`
coverage run -a -m pyspedas.projects.mica.tests.test_mica
echo Starting ulysses tests at `date`
coverage run -a -m pyspedas.projects.ulysses.tests.test_ulysses
echo Starting solo tests at `date`
coverage run -a -m pyspedas.projects.solo.tests.test_solo
echo Starting themis_check_args tests at `date`
coverage run -a -m pyspedas.projects.themis.tests.test_themis_check_args
echo Starting themis autoload support tests at `date`
coverage run -a -m pyspedas.projects.themis.tests.test_themis_autoload_support
echo Starting themis cal_fit tests at `date`
coverage run -a -m pyspedas.projects.themis.tests.test_themis_cal_fit
echo Starting themis dsl_cotrans tests at `date`
coverage run -a -m pyspedas.projects.themis.tests.test_themis_dsl_cotrans
echo Starting themis lunar_cotrans tests at `date`
coverage run -a -m pyspedas.projects.themis.tests.test_themis_lunar_cotrans
echo Starting themis spinmodel tests at `date`
coverage run -a -m pyspedas.projects.themis.tests.test_themis_spinmodel
echo Starting themis state tests at `date`
coverage run -a -m pyspedas.projects.themis.tests.test_themis_state
echo Starting themis scpot2dens tests at `date`
coverage run -a -m pyspedas.projects.themis.tests.test_themis_scpot2dens
echo Starting themis tplot_time tests at `date`
coverage run -a -m pyspedas.projects.themis.tests.test_themis_tplot_time
echo Starting barrel tests at `date`
coverage run -a -m pyspedas.projects.barrel.tests.test_barrel
echo "========================================================="
# Show the free disk space on this filesystem
echo "Disk usage after spdf, themis, etc test:"
df -h
echo "Cleaning downloaded files"
rm -rf "$DATA_ROOT"/*
rm -rf "$SPEDAS_DATA_DIR"/*
# Show the free disk space on this filesystem
echo "Disk usage after cleanup:"
df -h
- shard: mms
shard_script: |
# This set of tests is mostly for MMS
echo IP address for this test:
coverage run -a -m pyspedas.utilities.tests.test_find_ip_address
# This is good to have in case any tests access MMS data
echo "Setting up credentials for MMS tests"
python -m pyspedas.projects.mms.tests.test_mms_setup
echo "Starting mms data rate seg tests at $(date)"
coverage run -m pyspedas.projects.mms.tests.test_mms_data_rate_seg
echo Starting mms cotrans tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_cotrans
echo Starting mms events tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_events
echo Starting mms orbit_plots tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_orbit_plots
echo Starting mms overview_plots tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_overview_plots
echo Starting mms neutral sheet tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_neutral_sheet
echo Starting mms ql_lib_sitl tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_ql_l1b_sitl
echo Starting mms_part_getspec tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_part_getspec
echo Starting mms_part_getspec FPI bulk velocity subtraction tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_getspec_bulkv
echo Starting mms load routine tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_load_routine
echo Starting mms feeps tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_feeps
echo Starting mms eis tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_eis
echo Starting mms fpi tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_fpi
echo Starting mms file_filter tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_file_filter
echo Starting mms curlometer tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_curlometer
echo Starting mms wavpol tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_wavpol
echo Starting mms slice2d tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_slice2d
#echo Starting mms S3 tests at `date`
#coverage run -a -m pyspedas.projects.mms.tests.test_mms_load_uri
echo "========================================================="
# Show the free disk space on this filesystem
echo "Disk usage after MMS test group:"
df -h
du -sh "$MMS_DATA_DIR" 2>/dev/null || true
echo "Cleaning MMS downloads"
rm -rf "$MMS_DATA_DIR"/*
rm -rf "$DATA_ROOT"/*
rm -rf "$SPEDAS_DATA_DIR"/*
# Show the free disk space on this filesystem
echo "Disk usage after cleanup:"
df -h
- shard: erg_maven_etc
shard_script: |
# This set of tests exercises mostly MAVEN and ERG routines
# This is good to have in case any tests access MMS data
echo "Setting up credentials for MMS tests"
python -m pyspedas.projects.mms.tests.test_mms_setup
echo Starting erg tests at `date`
coverage run -a -m pyspedas.projects.erg.tests.test_erg
echo Starting erg cotrans tests at `date`
coverage run -a -m pyspedas.projects.erg.tests.test_erg_cotrans
echo Starting erg ground data tests at `date`
coverage run -a -m pyspedas.projects.erg.tests.test_erg_ground
echo Starting erg mepe particle tests at `date`
coverage run -a -m pyspedas.projects.erg.tests.test_erg_mepe
echo Starting erg mepi particle tests at `date`
coverage run -a -m pyspedas.projects.erg.tests.test_erg_mepi
echo Starting erg lepe particle tests at `date`
coverage run -a -m pyspedas.projects.erg.tests.test_erg_lepe
echo Starting erg lepi particle tests at `date`
coverage run -a -m pyspedas.projects.erg.tests.test_erg_lepi
echo Starting erg xep particle tests at `date`
coverage run -a -m pyspedas.projects.erg.tests.test_erg_xep
echo Starting erg hep particle tests at `date`
coverage run -a -m pyspedas.projects.erg.tests.test_erg_hep
echo "========================================================="
# Show the free disk space on this filesystem
echo "Disk space after ERG tests:"
df -h .
# Clean up files downloaded so far
/bin/rm -rf data/*
echo "Disk space after cleanup:"
df -h .
echo "========================================================="
echo Starting MTH5 import test at `date`
coverage run -a -m pyspedas.mth5.tests.test_mth5_import
echo Starting MTH5 load_fdsn test at `date`
coverage run -a -m pyspedas.mth5.tests.test_load_fdsn
echo Starting akebono tests at `date`
coverage run -a -m pyspedas.projects.akebono.tests.test_akebono
#echo Starting maven S3 tests at `date`
#coverage run -a -m pyspedas.projects.maven.tests.test_maven_uri
echo Starting maven tests at `date`
coverage run -a -m pyspedas.projects.maven.tests.test_maven
echo Starting VIRES client tests at `date`
coverage run -a -m pyspedas.vires.tests.test_vires
echo Starting secs tests at `date`
coverage run -a -m pyspedas.projects.secs.tests.test_secs
echo Starting particles tests at `date`
coverage run -a -m pyspedas.particles.tests.test_particles
echo "========================================================="
# Show the free disk space on this filesystem
echo "Disk usage after ERG,MAVEN,etc test group:"
df -h
du -sh "$MMS_DATA_DIR" 2>/dev/null || true
echo "Cleaning downloads"
rm -rf "$DATA_ROOT"/*
rm -rf "$SPEDAS_DATA_DIR"/*
# Show the free disk space on this filesystem
echo "Disk usage after cleanup:"
df -h
- shard: elfin_goes_poes_etc
shard_script: |
# This set of tests exercises ELFIN, GOES, POES and a few other routines
# This is good to have in case any tests access MMS data
echo "Setting up credentials for MMS tests"
coverage run -a -m pyspedas.projects.mms.tests.test_mms_setup
echo Starting elfin epd_l1 tests at `date`
coverage run -a -m pyspedas.projects.elfin.tests.test_epd_l1
echo Starting elfin epd_l2 tests at `date`
coverage run -a -m pyspedas.projects.elfin.tests.test_epd_l2
echo Starting elfin state tests at `date`
coverage run -a -m pyspedas.projects.elfin.tests.test_state
echo Starting elfin tests at `date`
coverage run -a -m pyspedas.projects.elfin.tests.test_elfin
echo Starting elfin epd calibration tests at `date`
coverage run -a -m pyspedas.projects.elfin.tests.test_epd_calibration
echo Starting noaa tests at `date`
coverage run -a -m pyspedas.projects.noaa.tests.test_noaa
echo "========================================================="
coverage run -a -m pyspedas.projects.poes.tests.test_poes
echo Starting polar tests at `date`
coverage run -a -m pyspedas.projects.polar.tests.test_polar
echo Starting geopack tests at `date`
coverage run -a -m pyspedas.geopack.tests.test_geopack
echo Starting geopack-IDL validation tests at `date`
coverage run -a -m pyspedas.geopack.tests.test_geopack_idl_validation
echo Starting geopack clean_model_parameters tests at `date`
coverage run -a -m pyspedas.geopack.tests.test_clean_model_parameters
echo Starting geopack-IDL field line tracing validation tests at `date`
coverage run -a -m pyspedas.geopack.tests.test_fl_tracing
echo Starting geotail tests at `date`
coverage run -a -m pyspedas.projects.geotail.tests.test_geotail
echo Starting analysis tests at `date`
coverage run -a -m pyspedas.analysis.tests.test_analysis
echo Starting analysis wavpol tests at `date`
coverage run -a -m pyspedas.analysis.tests.test_twavpol
echo Starting analysis wavelet tests at `date`
coverage run -a -m pyspedas.analysis.tests.test_wavelet
echo Starting analysis magnetic nulls tests at `date`
coverage run -a -m pyspedas.analysis.tests.test_magnetic_nulls
echo Starting goes tests at `date`
coverage run -a -m pyspedas.projects.goes.tests.test_goes
echo Starting kyoto tests at `date`
coverage run -a -m pyspedas.projects.kyoto.tests.test_kyoto
echo Starting swarm tests at `date`
coverage run -a -m pyspedas.projects.swarm.tests.test_swarm
echo "========================================================="
# Show the free disk space on this filesystem
echo "Disk usage after elfin, goes, poes etc test group:"
df -h
rm -rf "$DATA_ROOT"/*
rm -rf "$SPEDAS_DATA_DIR"/*
# Show the free disk space on this filesystem
echo "Disk usage after cleanup:"
df -h
steps:
- uses: actions/checkout@v5
- name: Set up Python 3.12
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Download wheel artifact
uses: actions/download-artifact@v8
with:
name: dist-wheel
path: dist
- name: Install dependencies and wheel
run: |
python -m venv ../.venv
source ../.venv/bin/activate
python -m pip install --upgrade pip
pip install pdm uv
pdm config use_uv true
pdm install -dG lint -dG test -dG setup --no-default
wheelbase=$(echo dist/*.whl)
pip install "${wheelbase}[all]"
python -m pyspedas.projects.mms.tests.test_mms_setup
- name: Hide the repo copy so imports use site-packages
run: |
if [ -d pyspedas ]; then mv pyspedas __repo_pyspedas; fi
- name: Sanity check import location
run: |
source ../.venv/bin/activate
python - <<'PY'
import pyspedas, pathlib, sys
p = pathlib.Path(pyspedas.__file__).resolve()
print("sys.executable:", sys.executable)
print("pyspedas import path:", p)
print("sys.path[0]:", sys.path[0])
assert "site-packages" in str(p), f"Still importing from repo: {p}"
PY
- name: Run shard script
env:
DATA_ROOT: ${{ runner.temp }}/spedas-${{ matrix.shard }}/
SPEDAS_DATA_DIR: ${{ runner.temp }}/spedas-${{ matrix.shard }}/data/
ACE_DATA_DIR: ${{ runner.temp }}/spedas-${{ matrix.shard }}/ace_data/
BARREL_DATA_DIR: ${{ runner.temp }}/spedas-${{ matrix.shard }}/barrel_data/
CLUSTER_DATA_DIR: ${{ runner.temp }}/spedas-${{ matrix.shard }}/cluster_data/
DSC_DATA_DIR: ${{ runner.temp }}/spedas-${{ matrix.shard }}/dsc_data/
CSSWE_DATA_DIR: ${{ runner.temp }}/spedas-${{ matrix.shard }}/csswe_data/
EQUATORS_DATA_DIR: ${{ runner.temp }}/spedas-${{ matrix.shard }}/eqs_data/
FAST_DATA_DIR: ${{ runner.temp }}/spedas-${{ matrix.shard }}/fast_data/
GEOTAIL_DATA_DIR: ${{ runner.temp }}/spedas-${{ matrix.shard }}/geotail_data/
GOES_DATA_DIR: ${{ runner.temp }}/spedas-${{ matrix.shard }}/goes_data/
IMAGE_DATA_DIR: ${{ runner.temp }}/spedas-${{ matrix.shard }}/img_data/
MICA_DATA_DIR: ${{ runner.temp }}/spedas-${{ matrix.shard }}/mica_data/
MMS_DATA_DIR: ${{ runner.temp }}/spedas-${{ matrix.shard }}/mms_data/
OMNI_DATA_DIR: ${{ runner.temp }}/spedas-${{ matrix.shard }}/omni_data/
POES_DATA_DIR: ${{ runner.temp }}/spedas-${{ matrix.shard }}/poes_data/
POLAR_DATA_DIR: ${{ runner.temp }}/spedas-${{ matrix.shard }}/polar_data/
PSP_DATA_DIR: ${{ runner.temp }}/spedas-${{ matrix.shard }}/psp_data/
RBSP_DATA_DIR: ${{ runner.temp }}/spedas-${{ matrix.shard }}/rbsp_data/
SOLO_DATA_DIR: ${{ runner.temp }}/spedas-${{ matrix.shard }}/solo_data/
STEREO_DATA_DIR: ${{ runner.temp }}/spedas-${{ matrix.shard }}/stereo_data/
THM_DATA_DIR: ${{ runner.temp }}/spedas-${{ matrix.shard }}/themis_data/
TWINS_DATA_DIR: ${{ runner.temp }}/spedas-${{ matrix.shard }}/twins_data/
ULY_DATA_DIR: ${{ runner.temp }}/spedas-${{ matrix.shard }}/uly_data/
WIND_DATA_DIR: ${{ runner.temp }}/spedas-${{ matrix.shard }}/wind_data/
LANL_DATA_DIR: ${{ runner.temp }}/spedas-${{ matrix.shard }}/lanl_data/
CNOFS_DATA_DIR: ${{ runner.temp }}/spedas-${{ matrix.shard }}/cnofs_data/
ST5_DATA_DIR: ${{ runner.temp }}/spedas-${{ matrix.shard }}/st5_data/
PYTPLOT_LOGGING_LEVEL: error
VIRES_TOKEN: ${{ secrets.VIRES_AUTH }}
MMS_AUTH_U: ${{ secrets.MMS_AUTH_U }}
MMS_AUTH_P: ${{ secrets.MMS_AUTH_P }}
run: |
source ../.venv/bin/activate
mkdir -p "$DATA_ROOT"
export COVERAGE_FILE=".coverage.${{ matrix.shard }}"
${{ matrix.shard_script }}
- name: Restore repo copy
if: ${{ always() }}
run: |
if [ -d __repo_pyspedas ]; then mv __repo_pyspedas pyspedas; fi
- name: Debug coverage files
if: ${{ always() }}
run: |
pwd
ls -la
find . -maxdepth 2 -name '.coverage*' -ls
- name: Upload raw coverage data
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: coverage-${{ matrix.shard }}
path: .coverage.${{ matrix.shard }}
retention-days: 7
if-no-files-found: error
include-hidden-files: true
- name: Final cleanup
if: ${{ always() }}
run: |
rm -rf "$DATA_ROOT"
combine_coverage:
runs-on: ubuntu-latest
needs: tests
if: ${{ always() && ((github.event_name == 'pull_request' && github.base_ref == 'master') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/refactor_projects' || github.ref == 'refs/heads/pyspedas_2_0_dev') }}
steps:
- uses: actions/checkout@v5
- name: Set up Python 3.12
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install tools
run: |
python -m pip install --upgrade pip coverage
- name: Download coverage artifacts
uses: actions/download-artifact@v8
with:
pattern: coverage-*
merge-multiple: true
path: coverage-files
- name: Combine coverage and generate XML
run: |
ls -la coverage-files
cp coverage-files/.coverage.* .
coverage combine .coverage.*
coverage xml --debug=pathmap
grep avg_data coverage.xml || true
- name: Upload combined report to Coveralls
uses: coverallsapp/github-action@v2
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: coverage.xml
format: cobertura