-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (98 loc) · 3.98 KB
/
Copy pathci.yml
File metadata and controls
108 lines (98 loc) · 3.98 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
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
# Honoured by `cmake --build` and `ctest` on every generator, so the build
# and test steps stay identical across all four runners. Set explicitly
# because a bare `cmake --build --parallel` hands Make an unbounded -j.
# 4 vCPU on the Linux and Windows runners, 3 on macos-15 arm64.
CMAKE_BUILD_PARALLEL_LEVEL: "4"
CTEST_PARALLEL_LEVEL: "4"
jobs:
build-test:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
# Report every platform, even when one fails.
fail-fast: false
matrix:
include:
- { os: ubuntu-24.04, name: Linux x64 (GCC) }
- { os: ubuntu-24.04-arm, name: Linux arm64 (GCC) }
- { os: windows-latest, name: Windows x64 (MSVC) }
- { os: macos-15, name: macOS arm64 (AppleClang) }
steps:
- uses: actions/checkout@v4
# -DCMAKE_BUILD_TYPE is for single-config generators and is ignored by
# the Visual Studio generator; --config / -C below cover that case.
- name: Configure
run: >
cmake -B build
-DBUILD_TESTING=ON
-DCMAKE_BUILD_TYPE=Release
-DTM30_ENABLE_WARNINGS=ON
- name: Build
run: cmake --build build --config Release
# -E timing drops the single wall-clock-baseline case
# (tests/slice_13_parallel_test.cpp), whose thresholds are calibrated to
# one specific dev machine and are meaningless on a shared runner. It
# still runs by default locally via ./build/tm30-tests.
#
# Do NOT "simplify" this to `ctest -LE timing`: catch_discover_tests does
# not export Catch2 tags as ctest LABELS, so -LE matches nothing and
# every test runs, timing test included. Verified against the generated
# CTestTestfile.
#
# --no-tests=error makes a broken catch_discover_tests a red job instead
# of a green one that silently ran zero tests.
- name: Test
run: >
ctest --test-dir build -C Release
-E timing
--output-on-failure
--no-tests=error
data-reproducibility:
name: Data tables reproducible
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.13'
# Pinned environment. Byte-identity holds only on the generating
# platform (macOS arm64, see PROVENANCE.md): numpy/libm rounding
# differs in the last ULP per architecture, so this Linux runner
# checks numeric equivalence instead -- exact structure, values
# within the bounds in tools/check_data_reproducibility.py.
- run: python -m pip install "colour-science==0.4.7" "numpy==2.5.2"
- run: cp -r data data-committed
- run: python tools/generate_data_colour_science.py
- run: python tools/generate_planckian_lut.py
- run: python tools/check_data_reproducibility.py data-committed data
lint:
name: Lint (pre-commit)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: python -m pip install pre-commit
# fix_unicode.py is in its own scope, so a literal glyph in its mapping
# tables makes the hook rewrite (and break) itself. This asserts the
# tables are intact and the file is a fixed point before the hook runs,
# so the failure reads as a test name rather than a mangled diff.
- run: python3 tools/test_fix_unicode.py -v
# Every float literal in src/ and include/ carries a TM-30-20 clause
# tag, and every tag names a clause in tools/tm30_clause_equations.txt.
- run: python3 tools/check_constants.py
# Runs fix-unicode (ASCII-only gate) and clang-format over the tree.
- run: pre-commit run --all-files --show-diff-on-failure