Repository navigation
568 lines (493 loc) · 22.1 KB
/
Copy pathci.yml
File metadata and controls
568 lines (493 loc) · 22.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
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
name: CI
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '23 2 * * 1'
permissions:
contents: read
env:
CONFIGURATION: Release
DOTNET_CI_ARGS: -p:ContinuousIntegrationBuild=true
MAIN_SOLUTION: OpticalSystemDesign.slnx
MAIN_TEST_PROJECT: tests/OpticalSystemDesign.Tests/OpticalSystemDesign.Tests.csproj
COMPARISON_TEST_PROJECT: tests/OpticalSystemDesign.ZemaxComparison.Tests/OpticalSystemDesign.ZemaxComparison.Tests.csproj
CURRENT_TEST_FILTER: 'AcceptanceScope!=RetiredReference'
MAIN_TEST_HANG_TIMEOUT: 30m
LAB_TEST_PROJECT: labs/InitialStructure/tests/OpticalSystemDesign.InitialStructure.Tests/OpticalSystemDesign.InitialStructure.Tests.csproj
COATING_TEST_PROJECT: labs/CoatingDesign/tests/OpticalSystemDesign.CoatingDesign.Tests/OpticalSystemDesign.CoatingDesign.Tests.csproj
LAB_TEST_HANG_TIMEOUT: 35m
jobs:
local-ui-catalog:
name: Local UI catalog (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Restore localization tool
run: dotnet restore tools/OpticalSystemDesign.Localization/OpticalSystemDesign.Localization.csproj --locked-mode
- name: Check extracted UI, local translations and protected data
run: dotnet run --project tools/OpticalSystemDesign.Localization -c Release --no-restore -- check .
- name: Verify missing-text and damaged-resource rejection
shell: pwsh
run: ./tools/OpticalSystemDesign.Localization/VerifyPipeline.ps1 -OutputDirectory '${{ runner.temp }}/localization-controls'
frozen-evidence:
name: Frozen evidence (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Verify working and committed frozen bytes
shell: pwsh
run: |
$evidence = Join-Path '${{ runner.temp }}' 'frozen-evidence'
New-Item -ItemType Directory -Path $evidence -Force | Out-Null
./tools/validation/GitFrozenIntegrity.ps1 -RepositoryRoot . -ManifestPath ./artifacts/validation/n02-layer-diagnosis-20261009/frozen-after.json -ExpectedAggregateSha256 3a5fde98e1c881700f00be1c62d6ab4ff6f4feacc90454046ed787e80bf28c10 -RelocationMapPath tools/validation/frozen-evidence-relocations.json -ExpectedRelocationMapSha256 6eefb25cbb1c35a120f73e8bbb761aac16759e7b8491b4606475caec8dfd4f6e -OutputPath (Join-Path $evidence 'integrity.json')
if ($LASTEXITCODE) { exit $LASTEXITCODE }
- name: Test Git frozen-byte checks
shell: pwsh
run: |
./tools/validation/FrozenIntegrity.Tests.ps1 -OutputDirectory (Join-Path '${{ runner.temp }}' 'frozen-working-tests')
if ($LASTEXITCODE) { exit $LASTEXITCODE }
./tools/validation/GitFrozenIntegrity.Tests.ps1 -OutputDirectory (Join-Path '${{ runner.temp }}' 'frozen-evidence-tests')
if ($LASTEXITCODE) { exit $LASTEXITCODE }
- name: Verify consolidated evidence and test alias guards
shell: pwsh
run: |
./tools/validation/EvidenceAliases.ps1 -FetchLfs -OutputPath (Join-Path '${{ runner.temp }}' 'frozen-evidence/aliases.json')
./tools/validation/EvidenceAliases.Tests.ps1 -OutputDirectory (Join-Path '${{ runner.temp }}' 'evidence-alias-tests')
./tools/validation/EvidenceStorage.Tests.ps1 -OutputDirectory (Join-Path '${{ runner.temp }}' 'evidence-storage-tests')
./tools/validation/HistoricalEvidence.ps1 -OutputPath (Join-Path '${{ runner.temp }}' 'frozen-evidence/historical-compression.json')
./tools/validation/HistoricalEvidence.Tests.ps1 -OutputDirectory (Join-Path '${{ runner.temp }}' 'historical-evidence-tests')
- name: Upload frozen-byte results
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: frozen-evidence-${{ matrix.os }}
path: |
${{ runner.temp }}/frozen-evidence
${{ runner.temp }}/frozen-working-tests/results.json
${{ runner.temp }}/frozen-evidence-tests/results.json
${{ runner.temp }}/evidence-alias-tests/results.json
${{ runner.temp }}/evidence-storage-tests/results.json
${{ runner.temp }}/historical-evidence-tests/results.json
if-no-files-found: warn
documentation:
name: Documentation (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Verify documentation links and current-guide duplication
shell: pwsh
run: |
./scripts/verify-documentation.ps1 -Strict -OutputPath (Join-Path '${{ runner.temp }}' 'documentation/audit.json')
- name: Test documentation checker
shell: pwsh
run: |
./scripts/tests/verify-documentation.tests.ps1 -OutputPath (Join-Path '${{ runner.temp }}' 'documentation/tests.json')
- name: Upload documentation results
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: documentation-${{ matrix.os }}
path: ${{ runner.temp }}/documentation
if-no-files-found: warn
build-main:
name: Build main
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
cache: true
cache-dependency-path: '**/packages.lock.json'
- name: Restore locked dependencies
run: dotnet restore ${{ env.MAIN_SOLUTION }} --locked-mode ${{ env.DOTNET_CI_ARGS }}
- name: Build main solution
run: dotnet build ${{ env.MAIN_SOLUTION }} -c ${{ env.CONFIGURATION }} --no-restore /m:1 /nr:false ${{ env.DOTNET_CI_ARGS }}
test-main:
name: Main tests (${{ matrix.label }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
label: linux
- os: macos-latest
label: macos
- os: windows-latest
label: windows
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
cache: true
cache-dependency-path: '**/packages.lock.json'
- name: Restore locked dependencies
run: dotnet restore ${{ env.MAIN_SOLUTION }} --locked-mode ${{ env.DOTNET_CI_ARGS }}
- name: Build main solution
id: build
run: dotnet build ${{ env.MAIN_SOLUTION }} -c ${{ env.CONFIGURATION }} --no-restore /m:1 /nr:false ${{ env.DOTNET_CI_ARGS }}
- name: Test main solution
run: >-
dotnet test
${{ env.MAIN_TEST_PROJECT }}
-c ${{ env.CONFIGURATION }}
--filter "${{ env.CURRENT_TEST_FILTER }}"
--no-build
--logger "trx;LogFileName=main-${{ matrix.label }}.trx"
--results-directory "${{ runner.temp }}/test-results/main"
--blame-hang --blame-hang-timeout ${{ env.MAIN_TEST_HANG_TIMEOUT }}
/m:1 /nr:false
- name: Test portable Zemax comparison (no licensed application)
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: >-
dotnet test
${{ env.COMPARISON_TEST_PROJECT }}
-c ${{ env.CONFIGURATION }}
--filter "${{ env.CURRENT_TEST_FILTER }}"
--no-build --no-restore
--logger "trx;LogFileName=comparison-${{ matrix.label }}.trx"
--results-directory "${{ runner.temp }}/test-results/main"
--blame-hang --blame-hang-timeout 30m
/m:1 /nr:false
# Both test projects exclude only retired reference comparisons. Current UI
# contracts run above; native navigation and real rendering also run in isolation.
- name: Verify lens navigation in isolated native processes
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
shell: pwsh
run: |
$results = Join-Path '${{ runner.temp }}' 'desktop-ui'
if ($IsMacOS) {
$reports = Join-Path $results 'native-crash'
[void][IO.Directory]::CreateDirectory($reports)
$env:DOTNET_DbgEnableMiniDump = '1'
$env:DOTNET_EnableCrashReportOnly = '1'
$env:DOTNET_DbgMiniDumpName = Join-Path $reports 'navigation.%p'
$env:OPTICAL_SYSTEM_DESIGN_NAVIGATION_TRACE = Join-Path $reports 'navigation-stages.txt'
}
./scripts/test-lens-navigation-release.ps1 -ResultsDirectory $results -Configuration $env:CONFIGURATION
if ($LASTEXITCODE) { exit $LASTEXITCODE }
- name: Render update check feedback in three languages
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
shell: pwsh
env:
OPTICAL_SYSTEM_DESIGN_UPDATE_CAPTURE_DIR: ${{ runner.temp }}/desktop-ui/update-feedback
run: |
dotnet test $env:MAIN_TEST_PROJECT -c $env:CONFIGURATION --no-build --no-restore --filter 'FullyQualifiedName~AboutUpdateTests.CheckButtonShowsBusyProgressAndPersistentLocalizedResults' --logger 'trx;LogFileName=update-feedback-render.trx' --results-directory '${{ runner.temp }}/desktop-ui'
if ($LASTEXITCODE) { exit $LASTEXITCODE }
- name: Render complete analysis pages in an isolated Skia process
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
shell: pwsh
env:
OPTICAL_SYSTEM_DESIGN_ANALYSIS_FIT_CAPTURE_DIR: ${{ runner.temp }}/desktop-ui/analysis-pages
run: |
dotnet test $env:MAIN_TEST_PROJECT -c $env:CONFIGURATION --no-build --no-restore --filter 'FullyQualifiedName~AnalysisResponsivePlotTests' --logger 'trx;LogFileName=analysis-render.trx' --results-directory '${{ runner.temp }}/desktop-ui'
if ($LASTEXITCODE) { exit $LASTEXITCODE }
- name: Verify complete PNG export in an isolated Skia process
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
shell: pwsh
env:
OPTICAL_SYSTEM_DESIGN_ANALYSIS_EXPORT_CAPTURE_DIR: ${{ runner.temp }}/desktop-ui/analysis-export
run: |
dotnet test $env:MAIN_TEST_PROJECT -c $env:CONFIGURATION --no-build --no-restore --filter 'FullyQualifiedName~AnalysisImageExportTests' --logger 'trx;LogFileName=analysis-export.trx' --results-directory '${{ runner.temp }}/desktop-ui'
if ($LASTEXITCODE) { exit $LASTEXITCODE }
- name: Retain authorized bounded cloud Mac test crash reports
if: ${{ failure() && matrix.label == 'macos' }}
shell: bash
run: |
# Only temporary GitHub runner test processes; no maintainer files.
reports='${{ runner.temp }}/desktop-ui/native-crash'
mkdir -p "$reports"
count=0
sleep 2
for directory in "$HOME/Library/Logs/DiagnosticReports" "$HOME/Library/Logs/DiagnosticReports/Retired"; do
for report in "$directory"/{testhost,dotnet}*.{ips,crash}; do
[[ -f "$report" ]] || continue
if [[ $(stat -f%z "$report") -le 20971520 && $count -lt 5 ]]; then
cp "$report" "$reports/"
count=$((count+1))
fi
done
done
- name: Upload isolated desktop UI results
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: desktop-ui-${{ matrix.label }}
path: ${{ runner.temp }}/desktop-ui
if-no-files-found: warn
retention-days: 30
- name: Upload main test results
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: test-main-${{ matrix.label }}
path: ${{ runner.temp }}/test-results/main
if-no-files-found: warn
test-lab:
name: Built-in module tests (${{ matrix.os }}, ${{ matrix.partition }})
runs-on: ${{ matrix.os }}
timeout-minutes: 240
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-latest, windows-latest]
partition: [contracts, survey-first, survey-second]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
cache: true
cache-dependency-path: '**/packages.lock.json'
- name: Restore complete product
run: dotnet restore ${{ env.MAIN_SOLUTION }} --locked-mode ${{ env.DOTNET_CI_ARGS }}
- name: Build complete product
run: dotnet build ${{ env.MAIN_SOLUTION }} -c ${{ env.CONFIGURATION }} --no-restore /m:1 /nr:false ${{ env.DOTNET_CI_ARGS }}
- name: Test built-in initial structure
run: >-
pwsh -NoProfile -File scripts/test-initial-structure-partition.ps1
-Partition ${{ matrix.partition }}
-Configuration ${{ env.CONFIGURATION }}
-ResultsDirectory "${{ runner.temp }}/test-results/lab"
-HangTimeout ${{ env.LAB_TEST_HANG_TIMEOUT }}
- name: Test built-in coating design
if: ${{ always() && matrix.partition == 'contracts' }}
run: >-
dotnet test
${{ env.COATING_TEST_PROJECT }}
-c ${{ env.CONFIGURATION }}
--no-build --no-restore
--logger "trx;LogFileName=coating-${{ matrix.os }}.trx"
--results-directory "${{ runner.temp }}/test-results/lab"
--blame-hang --blame-hang-timeout ${{ env.LAB_TEST_HANG_TIMEOUT }}
/m:1 /nr:false
- name: Upload built-in module test results
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: test-lab-${{ matrix.os }}-${{ matrix.partition }}
path: ${{ runner.temp }}/test-results/lab
if-no-files-found: warn
quality:
name: Repository quality
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
cache: true
cache-dependency-path: '**/packages.lock.json'
- name: Restore locked dependencies
run: dotnet restore ${{ env.MAIN_SOLUTION }} --locked-mode ${{ env.DOTNET_CI_ARGS }}
- name: Verify current 95-lens acceptance scope
run: |
pwsh -NoProfile -File scripts/verify-acceptance-scope.ps1
pwsh -NoProfile -File scripts/tests/verify-acceptance-scope.tests.ps1
- name: Verify formatting
run: dotnet format ${{ env.MAIN_SOLUTION }} --no-restore --verify-no-changes
- name: Verify immutable release action references
run: pwsh -NoProfile -File scripts/verify-release-actions.ps1
- name: Verify initial-structure partition coverage
run: pwsh -NoProfile -File scripts/tests/test-initial-structure-partition.tests.ps1
- name: Validate shell scripts
if: ${{ always() }}
run: |
bash -n Run-OpticalSystemDesign.command
bash -n scripts/publish-cross-platform.sh
dependency-audit:
name: Dependency vulnerability audit
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
cache: true
cache-dependency-path: '**/packages.lock.json'
- name: Restore locked dependencies
run: dotnet restore ${{ env.MAIN_SOLUTION }} --locked-mode ${{ env.DOTNET_CI_ARGS }}
- name: Audit direct and transitive packages
if: ${{ always() }}
run: >-
dotnet list ${{ env.MAIN_SOLUTION }} package
--vulnerable --include-transitive --no-restore
performance-smoke:
name: Performance smoke
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
cache: true
cache-dependency-path: '**/packages.lock.json'
- name: Restore locked dependencies
run: dotnet restore ${{ env.MAIN_SOLUTION }} --locked-mode ${{ env.DOTNET_CI_ARGS }}
- name: Build benchmark tool
run: >-
dotnet build
tools/OpticalSystemDesign.Benchmarks/OpticalSystemDesign.Benchmarks.csproj
-c ${{ env.CONFIGURATION }}
--no-restore /m:1 /nr:false ${{ env.DOTNET_CI_ARGS }}
- name: Run bounded performance smoke
run: >-
dotnet run
--project tools/OpticalSystemDesign.Benchmarks/OpticalSystemDesign.Benchmarks.csproj
-c ${{ env.CONFIGURATION }}
--no-build -- --ci-smoke
step-fixtures:
name: Generate STEP fixtures
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
cache: true
cache-dependency-path: '**/packages.lock.json'
- name: Restore locked dependencies
run: dotnet restore ${{ env.MAIN_SOLUTION }} --locked-mode ${{ env.DOTNET_CI_ARGS }}
- name: Build main solution
run: dotnet build ${{ env.MAIN_SOLUTION }} -c ${{ env.CONFIGURATION }} --no-restore /m:1 /nr:false ${{ env.DOTNET_CI_ARGS }}
- name: Generate STEP validation fixtures
env:
OPTICAL_SYSTEM_DESIGN_STEP_FIXTURE_DIR: ${{ runner.temp }}/step-fixtures
run: >-
dotnet test
${{ env.MAIN_TEST_PROJECT }}
-c ${{ env.CONFIGURATION }}
--no-build
--filter FullyQualifiedName~CadExportFreeCadFixtureTests
--logger "trx;LogFileName=step-fixtures.trx"
--results-directory "${{ runner.temp }}/test-results/step-fixtures"
/m:1 /nr:false
- name: Upload STEP validation fixtures
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: step-validation-fixtures
path: ${{ runner.temp }}/step-fixtures
if-no-files-found: warn
- name: Upload STEP fixture test results
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: step-fixture-test-results
path: ${{ runner.temp }}/test-results/step-fixtures
if-no-files-found: warn
step-validation:
name: STEP OpenCascade validation
runs-on: ubuntu-22.04
needs: step-fixtures
if: ${{ always() && needs.step-fixtures.result == 'success' }}
env:
FREECAD_APT_VERSION: 0.19.2+dfsg1-3ubuntu1
STEP_VALIDATION_LOG_DIR: ${{ github.workspace }}/step-validation-logs
steps:
- uses: actions/checkout@v4
- name: Download STEP validation fixtures
uses: actions/download-artifact@v4
with:
name: step-validation-fixtures
path: ${{ runner.temp }}/step-fixtures
- name: Restore fixed FreeCAD package cache
uses: actions/cache@v4
with:
path: ${{ runner.temp }}/freecad-debs
key: freecad-ubuntu-22.04-${{ env.FREECAD_APT_VERSION }}-v1
- name: Install fixed FreeCAD validation runtime
shell: bash
env:
FREECAD_DEB_CACHE_DIR: ${{ runner.temp }}/freecad-debs
run: |
set -euo pipefail
mkdir -p "$STEP_VALIDATION_LOG_DIR"
mkdir -p "$FREECAD_DEB_CACHE_DIR"
packages=(
freecad
freecad-common
freecad-python3
libfreecad-python3-0.19
)
specs=()
for package in "${packages[@]}"; do
specs+=("${package}=${FREECAD_APT_VERSION}")
done
sudo apt-get update 2>&1 | tee "$STEP_VALIDATION_LOG_DIR/apt-update.log"
apt-cache policy \
freecad \
freecad-common \
freecad-python3 \
libfreecad-python3-0.19 \
| tee "$STEP_VALIDATION_LOG_DIR/freecad-apt-policy.log"
if ! find "$FREECAD_DEB_CACHE_DIR" -maxdepth 1 -type f -name '*.deb' | grep -q .; then
(
cd "$FREECAD_DEB_CACHE_DIR"
apt-get download "${specs[@]}"
) 2>&1 | tee "$STEP_VALIDATION_LOG_DIR/freecad-download.log"
else
echo "Using cached FreeCAD deb packages from $FREECAD_DEB_CACHE_DIR" \
| tee "$STEP_VALIDATION_LOG_DIR/freecad-download.log"
fi
sha256sum "$FREECAD_DEB_CACHE_DIR"/*.deb \
| tee "$STEP_VALIDATION_LOG_DIR/freecad-deb-sha256.log"
sudo apt-get install --yes --no-install-recommends \
"$FREECAD_DEB_CACHE_DIR"/*.deb \
2>&1 | tee "$STEP_VALIDATION_LOG_DIR/freecad-install.log"
freecad_cmd="$(command -v FreeCADCmd || command -v freecadcmd || true)"
if [ -z "$freecad_cmd" ]; then
echo "FreeCAD command-line runtime was not installed." \
| tee "$STEP_VALIDATION_LOG_DIR/freecad-version.log"
exit 1
fi
{
echo "Runner image: ubuntu-22.04"
echo "Pinned FreeCAD apt version: ${FREECAD_APT_VERSION}"
echo "FreeCAD command: ${freecad_cmd}"
"$freecad_cmd" --version || true
} | tee "$STEP_VALIDATION_LOG_DIR/freecad-version.log"
- name: Validate STEP with OpenCascade
shell: bash
env:
OPTICAL_SYSTEM_DESIGN_STEP_FIXTURE_DIR: ${{ runner.temp }}/step-fixtures
run: |
set -euo pipefail
mkdir -p "$STEP_VALIDATION_LOG_DIR"
freecad_cmd="$(command -v FreeCADCmd || command -v freecadcmd || true)"
if [ -z "$freecad_cmd" ]; then
echo "FreeCAD command-line runtime is not available." \
| tee "$STEP_VALIDATION_LOG_DIR/opencascade-validation.log"
exit 1
fi
validator_path="$PWD/tools/step_validation/validate_freecad_import.py"
printf "exec(compile(open(r'%s','rb').read(),r'%s','exec'))\n" \
"$validator_path" "$validator_path" \
| "$freecad_cmd" -c 2>&1 \
| tee "$STEP_VALIDATION_LOG_DIR/opencascade-validation.log"
- name: Upload STEP validation logs
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: step-validation-logs
path: ${{ env.STEP_VALIDATION_LOG_DIR }}
if-no-files-found: warn