Repository navigation
168 lines (142 loc) · 4.72 KB
/
Copy pathci.yml
File metadata and controls
168 lines (142 loc) · 4.72 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
# SPDX-FileCopyrightText: 2026 Robomous
# SPDX-License-Identifier: Apache-2.0
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
build-and-test:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Configure
run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DSCN_WARNINGS_AS_ERRORS=ON
- name: Build
run: cmake --build build --config Release --parallel
- name: Test
run: ctest --test-dir build -C Release --output-on-failure
- name: Build and install Python wheel
run: |
python -m pip install --upgrade pip
python -m pip install -v ./python
- name: Python tests
run: |
python -m pip install pytest
python -m pytest python/tests -v
- name: Python examples
run: |
python python/examples/hello_engine.py
python python/examples/host_queries.py
python python/examples/load_and_run.py
python python/examples/host_controlled.py
python python/examples/storyboard_events.py
python python/examples/check_dsl.py
- name: Parity audit (C++ / C / Python)
run: python scripts/parity_audit.py
golden:
name: golden scenarios (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Configure
run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DSCN_BUILD_PYTHON=OFF
- name: Build scena-run
run: cmake --build build --config Release --target scena-run --parallel
# Bit-identity against the committed per-platform reference trace, plus
# the semantic checkpoints each scenario declares.
- name: Golden suite
run: python scripts/golden.py check-all
sanitize:
name: ASan + UBSan (ubuntu)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure
run: >
cmake -B build
-DCMAKE_BUILD_TYPE=Debug
-DSCN_SANITIZE=address,undefined
-DSCN_WARNINGS_AS_ERRORS=ON
-DSCN_BUILD_PYTHON=OFF
- name: Build
run: cmake --build build --parallel
- name: Test
run: ctest --test-dir build --output-on-failure
format:
name: clang-format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check formatting
run: ./scripts/format.sh --check
- name: detmath guard
run: ./scripts/check_detmath.sh
- name: Coverage matrix consistency
run: python3 scripts/check_coverage_matrix.py
determinism-trace:
name: determinism trace (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Configure
run: >
cmake -B build -DCMAKE_BUILD_TYPE=Release -DSCN_WARNINGS_AS_ERRORS=ON
-DSCN_BUILD_PYTHON=OFF -DSCN_BUILD_CAPI=OFF
- name: Build trace runner
run: cmake --build build --config Release --parallel --target scena-trace-runner
- name: Generate trace
shell: bash
run: |
RUNNER=build/bin/scena-trace-runner
[ -f "$RUNNER" ] || RUNNER=build/bin/Release/scena-trace-runner.exe # MSVC multi-config
"$RUNNER" trace.txt
- uses: actions/upload-artifact@v4
with:
name: determinism-trace-${{ matrix.os }}
path: trace.txt
if-no-files-found: error
determinism-cross:
name: cross-platform bit-identity
needs: determinism-trace
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
pattern: determinism-trace-*
path: traces
- name: Diff traces bit-exactly
run: |
ref=traces/determinism-trace-ubuntu-latest/trace.txt
test -f "$ref"
status=0
for os in macos-latest windows-latest; do
other="traces/determinism-trace-$os/trace.txt"
if cmp -s "$ref" "$other"; then
echo "ubuntu-latest vs $os: identical ($(wc -c < "$ref") bytes)"
else
echo "::error::trace mismatch: ubuntu-latest vs $os"
diff -u "$ref" "$other" | head -n 100 || true
status=1
fi
done
exit $status