-
Notifications
You must be signed in to change notification settings - Fork 0
707 lines (693 loc) · 25.2 KB
/
Copy pathmerge-validation.yml
File metadata and controls
707 lines (693 loc) · 25.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
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
name: Pull Request
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
permissions:
contents: read
concurrency:
group: pull-request-${{ github.ref }}
cancel-in-progress: true
env:
PRIK_GFORTRAN_BINARY: gfortran-13
PRIK_GFORTRAN_PACKAGE: gfortran-13
PRIK_IFX_VERSION: "2026.1.1"
PRIK_FLANG_VERSION: "22.1.8"
PRIK_FLANG_RUNTIME_VERSION: "22.1.7"
jobs:
static-analysis:
name: Static analysis · Ubuntu 24.04 · Python 3.12
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install QA dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[qa]"
- name: Verify static-analysis versions
run: python tools/check_static_analysis_versions.py
- name: Ruff lint
run: python -m ruff check .
- name: Ruff format
run: python -m ruff format --check .
- name: Wrapper-plan generator contracts
run: python tools/check_codegen_complexity.py
- name: Bandit security scan
run: python -m bandit -c pyproject.toml -r prik --severity-level medium --confidence-level medium
- name: Vulture dead-code scan
run: python -m vulture
- name: Radon complexity policy
env:
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
PUSH_BEFORE_SHA: ${{ github.event.before }}
run: python tools/check_radon_policy.py --base-ref auto
- name: Radon complexity report
continue-on-error: true
run: python -m radon cc prik -n C -s --total-average
- name: Radon maintainability report
continue-on-error: true
run: python -m radon mi prik -s
compiler-smoke:
name: Compiler smoke · ${{ matrix.display_name }}
needs: static-analysis
runs-on: ubuntu-24.04
timeout-minutes: 60
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- toolchain: ifx
display_name: Ubuntu 24.04 · Intel IFX 2026.1.1 · Python 3.12
environment: prik-ifx-2026.1.1
fortran_compiler: ifx
c_compiler: icx
cache_version: "2026.1.1-v2"
- toolchain: flang
display_name: Ubuntu 24.04 · LLVM Flang 22.1.8 · Python 3.12
environment: prik-flang-22.1.8
fortran_compiler: flang
c_compiler: clang
cache_version: "22.1.8-runtime-22.1.7-v1"
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[qa]"
- name: Cache compiler environment
id: compiler-cache
uses: actions/cache@v4
with:
path: ${{ runner.temp }}/${{ matrix.environment }}
key: fortran-toolchain-${{ runner.os }}-${{ matrix.toolchain }}-${{ matrix.cache_version }}
- name: Install Intel IFX and ICX
if: matrix.toolchain == 'ifx' && steps.compiler-cache.outputs.cache-hit != 'true'
shell: bash
run: |
conda create --yes --solver=libmamba \
--prefix "$RUNNER_TEMP/${{ matrix.environment }}" \
--override-channels \
--channel https://software.repos.intel.com/python/conda/ \
--channel conda-forge \
"ifx_linux-64=$PRIK_IFX_VERSION" \
"dpcpp_linux-64=$PRIK_IFX_VERSION"
- name: Install LLVM Flang and Clang
if: matrix.toolchain == 'flang' && steps.compiler-cache.outputs.cache-hit != 'true'
shell: bash
run: |
conda create --yes --solver=libmamba \
--prefix "$RUNNER_TEMP/${{ matrix.environment }}" \
--override-channels \
--channel conda-forge \
"flang=$PRIK_FLANG_VERSION" \
"clang=$PRIK_FLANG_VERSION" \
"libflang-rt=$PRIK_FLANG_RUNTIME_VERSION"
- name: Export coherent compiler profile
shell: bash
run: |
toolchain_prefix="$RUNNER_TEMP/${{ matrix.environment }}"
echo "$toolchain_prefix/bin" >> "$GITHUB_PATH"
echo "LD_LIBRARY_PATH=$toolchain_prefix/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" >> "$GITHUB_ENV"
- name: Verify compiler pair
shell: bash
run: |
"${RUNNER_TEMP}/${{ matrix.environment }}/bin/${{ matrix.fortran_compiler }}" --version
"${RUNNER_TEMP}/${{ matrix.environment }}/bin/${{ matrix.c_compiler }}" --version
- name: Show repository-owned lane plan
run: |
python tools/run_fortran_toolchain_lane.py \
--compiler "$RUNNER_TEMP/${{ matrix.environment }}/bin/${{ matrix.fortran_compiler }}" \
--junit-dir "$RUNNER_TEMP" \
--plan
- name: Run profile checks and strict smoke
env:
PYTHONPATH: .
HYPOTHESIS_PROFILE: ci
run: |
python tools/run_fortran_toolchain_lane.py \
--compiler "$RUNNER_TEMP/${{ matrix.environment }}/bin/${{ matrix.fortran_compiler }}" \
--junit-dir "$RUNNER_TEMP"
- name: Summarize failed pytest nodes
if: failure()
shell: bash
run: |
shopt -s nullglob
reports=("$RUNNER_TEMP"/pytest-toolchain-*-results.xml)
for report in "${reports[@]}"; do
python tools/print_pytest_failures.py "$report"
done
compiler-smoke-macos:
name: Compiler smoke · macOS 15 ARM64 · LLVM Flang · Python 3.12
needs: static-analysis
runs-on: macos-15
timeout-minutes: 60
permissions:
contents: read
env:
HOMEBREW_NO_AUTO_UPDATE: "1"
PRIK_MACOS_FLANG_ENVIRONMENT: prik-flang-macos
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[qa]"
- name: Install LLVM Flang and Clang
shell: bash
run: |
brew install flang
toolchain_prefix="$RUNNER_TEMP/$PRIK_MACOS_FLANG_ENVIRONMENT"
flang_prefix="$(brew --prefix flang)"
llvm_prefix="$(brew --prefix llvm)"
flang_c_include="$flang_prefix/include/flang"
test -f "$flang_c_include/ISO_Fortran_binding.h"
mkdir -p "$toolchain_prefix/bin"
ln -sf "$flang_prefix/bin/flang" "$toolchain_prefix/bin/flang"
ln -sf "$llvm_prefix/bin/clang" "$toolchain_prefix/bin/clang"
echo "$toolchain_prefix/bin" >> "$GITHUB_PATH"
echo "C_INCLUDE_PATH=$flang_c_include${C_INCLUDE_PATH:+:$C_INCLUDE_PATH}" >> "$GITHUB_ENV"
echo "DYLD_LIBRARY_PATH=$flang_prefix/lib:$llvm_prefix/lib${DYLD_LIBRARY_PATH:+:$DYLD_LIBRARY_PATH}" \
>> "$GITHUB_ENV"
- name: Verify macOS compiler pair
shell: bash
run: |
echo "runner image: ${ImageOS:-unknown} ${ImageVersion:-unknown}"
sw_vers
uname -m
python --version
command -v flang
flang --version
command -v clang
clang --version
printf '#include <ISO_Fortran_binding.h>\n' |
clang -std=c99 -fsyntax-only -x c -
- name: Show repository-owned lane plan
run: |
python tools/run_fortran_toolchain_lane.py \
--compiler flang \
--junit-dir "$RUNNER_TEMP" \
--plan
- name: Run profile checks and strict smoke
env:
PYTHONPATH: .
HYPOTHESIS_PROFILE: ci
run: |
python tools/run_fortran_toolchain_lane.py \
--compiler flang \
--junit-dir "$RUNNER_TEMP"
- name: Summarize failed pytest nodes
if: failure()
shell: bash
run: |
shopt -s nullglob
reports=("$RUNNER_TEMP"/pytest-toolchain-*-results.xml)
for report in "${reports[@]}"; do
python tools/print_pytest_failures.py "$report"
done
unit-tests:
name: ${{ matrix.display_name }}
needs: [compiler-smoke, compiler-smoke-macos]
runs-on: ubuntu-24.04
permissions:
contents: read
id-token: write
strategy:
fail-fast: false
matrix:
include:
- python-version: "3.10"
display_name: Unit tests · Ubuntu 24.04 · Python 3.10
coverage: false
- python-version: "3.11"
display_name: Unit tests · Ubuntu 24.04 · Python 3.11
coverage: false
- python-version: "3.12"
display_name: Unit tests + project coverage · Ubuntu 24.04 · Python 3.12
coverage: true
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[qa]"
- name: Install pinned GFortran
shell: bash
run: |
if ! command -v "$PRIK_GFORTRAN_BINARY" >/dev/null 2>&1; then
sudo apt-get update
sudo apt-get install --yes "$PRIK_GFORTRAN_PACKAGE"
fi
compiler_dir="$RUNNER_TEMP/prik-gfortran"
mkdir -p "$compiler_dir"
ln -sf "$(command -v "$PRIK_GFORTRAN_BINARY")" "$compiler_dir/gfortran"
echo "$compiler_dir" >> "$GITHUB_PATH"
"$compiler_dir/gfortran" --version
- name: Run tests
if: ${{ !matrix.coverage }}
shell: bash
env:
PYTHONPATH: .
HYPOTHESIS_PROFILE: ci
run: |
python -m pytest -q --randomly-seed=1 \
-o junit_family=legacy \
--junitxml="$RUNNER_TEMP/pytest-smoke-results.xml" \
tests/fortran \
-m toolchain_smoke \
--require-toolchain-smoke \
--prik-fortran-compiler=gfortran
python -m pytest -q --randomly-seed=1 \
-o junit_family=legacy \
--junitxml="$RUNNER_TEMP/pytest-suite-results.xml" \
-m "not real_library and not toolchain_smoke" \
tests/c \
tests/docs \
tests/fortran \
tests/tools \
tests/workflows
- name: Run tests with project coverage
if: ${{ matrix.coverage }}
shell: bash
env:
PYTHONPATH: .
HYPOTHESIS_PROFILE: ci
COVERAGE_PROCESS_START: ${{ github.workspace }}/pyproject.toml
run: |
python -m coverage run -m pytest -q --randomly-seed=1 \
-o junit_family=legacy \
--junitxml="$RUNNER_TEMP/pytest-smoke-results.xml" \
tests/fortran \
-m toolchain_smoke \
--require-toolchain-smoke \
--prik-fortran-compiler=gfortran
python -m coverage run -m pytest -q --randomly-seed=1 \
-o junit_family=legacy \
--junitxml="$RUNNER_TEMP/pytest-suite-results.xml" \
-m "not real_library and not toolchain_smoke" \
tests/c \
tests/docs \
tests/fortran \
tests/tools \
tests/workflows
- name: Summarize failed pytest nodes
if: failure()
shell: bash
run: |
shopt -s nullglob
reports=("$RUNNER_TEMP"/pytest-*-results.xml)
for report in "${reports[@]}"; do
python tools/print_pytest_failures.py "$report"
done
- name: Combine coverage data
if: ${{ matrix.coverage }}
run: python -m coverage combine
- name: Report coverage
if: ${{ matrix.coverage }}
run: python -m coverage report
- name: Emit coverage XML
if: ${{ matrix.coverage }}
run: python -m coverage xml -o coverage.xml
- name: Upload coverage to Codecov
if: ${{ matrix.coverage }}
uses: codecov/codecov-action@v6
with:
files: ./coverage.xml
flags: py312
use_oidc: true
fail_ci_if_error: true
unit-tests-macos:
name: Unit tests · macOS 15 ARM64 · Python 3.12
needs: [compiler-smoke, compiler-smoke-macos]
runs-on: macos-15
timeout-minutes: 120
permissions:
contents: read
env:
PRIK_GFORTRAN_BINARY: gfortran-13
PRIK_GCC_BINARY: gcc-13
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[qa]"
- name: Configure GNU Fortran and GCC 13
shell: bash
run: |
if ! command -v "$PRIK_GFORTRAN_BINARY" >/dev/null 2>&1 || \
! command -v "$PRIK_GCC_BINARY" >/dev/null 2>&1; then
brew install gcc@13
fi
compiler_dir="$RUNNER_TEMP/prik-gfortran"
mkdir -p "$compiler_dir"
ln -sf "$(command -v "$PRIK_GFORTRAN_BINARY")" "$compiler_dir/gfortran"
ln -sf "$(command -v "$PRIK_GCC_BINARY")" "$compiler_dir/gcc"
echo "$compiler_dir" >> "$GITHUB_PATH"
- name: Show macOS test environment
shell: bash
run: |
echo "runner image: ${ImageOS:-unknown} ${ImageVersion:-unknown}"
sw_vers
uname -m
python --version
command -v gfortran
gfortran --version
command -v gcc
gcc --version
- name: Show repository-owned lane plan
run: |
python tools/run_fortran_toolchain_lane.py \
--compiler gfortran \
--junit-dir "$RUNNER_TEMP" \
--plan
- name: Run compiler checks and strict smoke
env:
PYTHONPATH: .
HYPOTHESIS_PROFILE: ci
run: |
python tools/run_fortran_toolchain_lane.py \
--compiler gfortran \
--junit-dir "$RUNNER_TEMP"
- name: Run full suite without real-library examples
env:
PYTHONPATH: .
HYPOTHESIS_PROFILE: ci
run: |
python -m pytest -q --randomly-seed=1 \
-o junit_family=legacy \
--junitxml="$RUNNER_TEMP/pytest-macos-suite-results.xml" \
-m "not real_library and not toolchain_smoke" \
tests/c \
tests/docs \
tests/fortran \
tests/tools \
tests/workflows
- name: Summarize failed pytest nodes
if: failure()
shell: bash
run: |
shopt -s nullglob
reports=("$RUNNER_TEMP"/pytest-*-results.xml)
for report in "${reports[@]}"; do
python tools/print_pytest_failures.py "$report"
done
native-libraries:
name: BLAS + LAPACK + FFTPACK + MINPACK · Ubuntu 24.04 · Python 3.12
needs: [unit-tests, unit-tests-macos]
if: >-
${{ !contains(github.event.pull_request.labels.*.name, 'ignore-real-library-wrappers') }}
runs-on: ubuntu-24.04
timeout-minutes: 120
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[qa]"
python -m pip install \
"numpy==2.5.1" \
"meson==1.11.2" \
"ninja==1.13.0" \
"scipy==1.18.0"
- name: Install pinned GFortran and LAPACK link dependencies
shell: bash
run: |
packages=(libblas-dev liblapack-dev)
if ! command -v "$PRIK_GFORTRAN_BINARY" >/dev/null 2>&1; then
packages+=("$PRIK_GFORTRAN_PACKAGE")
fi
sudo apt-get update
sudo apt-get install --yes "${packages[@]}"
compiler_dir="$RUNNER_TEMP/prik-gfortran"
mkdir -p "$compiler_dir"
ln -sf "$(command -v "$PRIK_GFORTRAN_BINARY")" "$compiler_dir/gfortran"
echo "$compiler_dir" >> "$GITHUB_PATH"
"$compiler_dir/gfortran" --version
- name: Restore compiled native library cache
uses: actions/cache@v4
with:
path: ${{ runner.temp }}/prik-real-library-native
key: real-libraries-${{ runner.os }}-gfortran13-${{ hashFiles('examples/blas/native/**', 'examples/lapack/native/**') }}
- name: Run BLAS example and CI full-surface audit
env:
PYTHONPATH: .
HYPOTHESIS_PROFILE: ci
PRIK_REAL_LIBRARY_NATIVE_CACHE_DIR: ${{ runner.temp }}/prik-real-library-native
run: |
source examples/blas/build_all.sh
python -m pytest -q examples/blas/tests examples/blas/ci/full_surface.py
- name: Report reviewed LAPACK inventory
env:
PYTHONPATH: .
run: |
python - <<'PY'
from examples.lapack.routine_inventory import (
EXPECTED_LAPACK_PROCEDURES,
EXPECTED_LAPACK_SOURCE_FILES,
F2PY_SCALAR_WRITEBACK_ROUTINES,
ROUTINE_GROUPS,
ROUTINES,
SCIPY_VERSION,
)
print(f"SciPy version: {SCIPY_VERSION}")
print(f"LAPACK implementation sources: {EXPECTED_LAPACK_SOURCE_FILES}")
print(f"Expected PRIK procedures: {EXPECTED_LAPACK_PROCEDURES}")
print(f"Selected float64 correctness routines: {len(ROUTINES)}")
print(f"f2py scalar writebacks: {len(F2PY_SCALAR_WRITEBACK_ROUTINES)}")
for family, routines in ROUTINE_GROUPS.items():
print(f" {family}: {len(routines)}")
PY
- name: Run LAPACK example and CI full-surface audit
env:
PYTHONPATH: .
HYPOTHESIS_PROFILE: ci
PRIK_REAL_LIBRARY_NATIVE_CACHE_DIR: ${{ runner.temp }}/prik-real-library-native
run: |
source examples/lapack/build_all.sh
python -m pytest -q examples/lapack/tests examples/lapack/ci/full_surface.py
- name: Run FFTPACK 31-procedure full-surface audit
env:
PYTHONPATH: .
HYPOTHESIS_PROFILE: ci
run: |
source examples/fftpack/build_all.sh
python -m pytest -q examples/fftpack/tests
- name: Run MINPACK 22-procedure and parameter-array full-surface audit
env:
PYTHONPATH: .
HYPOTHESIS_PROFILE: ci
run: |
source examples/minpack/build_all.sh
python -m pytest -q examples/minpack/tests
documentation-benchmark:
name: Documentation performance benchmark · Ubuntu 24.04 ARM64 · Python 3.12
needs: native-libraries
if: >-
${{
always() &&
(needs.native-libraries.result == 'success' ||
(needs.native-libraries.result == 'skipped' &&
contains(github.event.pull_request.labels.*.name, 'ignore-real-library-wrappers')))
}}
runs-on: ubuntu-24.04-arm
timeout-minutes: 90
permissions:
contents: read
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: pyproject.toml
- name: Verify and record benchmark host
run: >-
python tools/benchmark_host.py
--require-machine aarch64
--require-arm-part 0xd49
--github-env "$GITHUB_ENV"
- name: Install benchmark dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[docs]" \
"numpy==2.5.1" \
"meson==1.11.2" \
"ninja==1.13.0"
- name: Install pinned GFortran
shell: bash
run: |
if ! command -v "$PRIK_GFORTRAN_BINARY" >/dev/null 2>&1; then
sudo apt-get update
sudo apt-get install --yes "$PRIK_GFORTRAN_PACKAGE"
fi
compiler_dir="$RUNNER_TEMP/prik-gfortran"
mkdir -p "$compiler_dir"
ln -sf "$(command -v "$PRIK_GFORTRAN_BINARY")" "$compiler_dir/gfortran"
echo "$compiler_dir" >> "$GITHUB_PATH"
"$compiler_dir/gfortran" --version
- name: Run correctness and rigorous performance suite
shell: bash
run: |
if (( GITHUB_RUN_NUMBER % 2 == 0 )); then
export PRIK_BENCHMARK_FIRST=f2py
else
export PRIK_BENCHMARK_FIRST=prik
fi
bash benchmarks/run.sh
- name: Generate public Performance snapshot
run: |
python tools/generate_performance_docs.py \
--commit "$GITHUB_SHA"
- name: Report measurement stability
run: |
python -m pyperf check \
benchmarks/results/f2py.json \
benchmarks/results/prik.json \
benchmarks/results/f2py-build.json \
benchmarks/results/prik-build.json
- name: Upload Performance snapshot and raw results
uses: actions/upload-artifact@v4
with:
name: performance-snapshot
path: |
benchmarks/results/f2py.json
benchmarks/results/prik.json
benchmarks/results/f2py-prik-first.json
benchmarks/results/f2py-f2py-first.json
benchmarks/results/prik-prik-first.json
benchmarks/results/prik-f2py-first.json
benchmarks/results/f2py-build.json
benchmarks/results/prik-build.json
docs/user/performance.md
docs/user/assets/performance-comparison.svg
docs/user/assets/build-time-comparison.svg
retention-days: 90
documentation-build:
name: Documentation site build · Ubuntu 24.04 · Python 3.12
needs: documentation-benchmark
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: pyproject.toml
- name: Install documentation dependencies
run: python -m pip install -e ".[docs,qa]"
- name: Download generated Performance snapshot
uses: actions/download-artifact@v4
with:
name: performance-snapshot
path: .
- name: Run documentation tests
run: python -m pytest -q tests/docs
- name: Build reviewed documentation
run: python -m mkdocs build --strict
merge-gate:
name: Validation · all required checks
if: ${{ always() }}
needs:
- static-analysis
- compiler-smoke
- compiler-smoke-macos
- unit-tests
- unit-tests-macos
- native-libraries
- documentation-benchmark
- documentation-build
runs-on: ubuntu-24.04
permissions: {}
env:
STATIC_ANALYSIS_RESULT: ${{ needs.static-analysis.result }}
COMPILER_SMOKE_RESULT: ${{ needs.compiler-smoke.result }}
COMPILER_SMOKE_MACOS_RESULT: ${{ needs.compiler-smoke-macos.result }}
UNIT_TESTS_RESULT: ${{ needs.unit-tests.result }}
UNIT_TESTS_MACOS_RESULT: ${{ needs.unit-tests-macos.result }}
NATIVE_LIBRARIES_RESULT: ${{ needs.native-libraries.result }}
DOCUMENTATION_BENCHMARK_RESULT: ${{ needs.documentation-benchmark.result }}
DOCUMENTATION_BUILD_RESULT: ${{ needs.documentation-build.result }}
IGNORE_NATIVE_LIBRARIES: ${{ contains(github.event.pull_request.labels.*.name, 'ignore-real-library-wrappers') }}
steps:
- name: Require every staged validation result
shell: bash
run: |
failed=0
for staged_result in \
"static-analysis=$STATIC_ANALYSIS_RESULT" \
"compiler-smoke=$COMPILER_SMOKE_RESULT" \
"compiler-smoke-macos=$COMPILER_SMOKE_MACOS_RESULT" \
"unit-tests=$UNIT_TESTS_RESULT" \
"unit-tests-macos=$UNIT_TESTS_MACOS_RESULT" \
"native-libraries=$NATIVE_LIBRARIES_RESULT" \
"documentation-benchmark=$DOCUMENTATION_BENCHMARK_RESULT" \
"documentation-build=$DOCUMENTATION_BUILD_RESULT"
do
stage=${staged_result%%=*}
result=${staged_result#*=}
if [[ "$stage" == "native-libraries" && \
"$result" == "skipped" && \
"$IGNORE_NATIVE_LIBRARIES" == "true" ]]; then
continue
fi
if [[ "$result" != "success" ]]; then
echo "::error::$stage finished with result: $result"
failed=1
fi
done
exit "$failed"