Repository navigation
ArSonMix AUTO PR0 dd27603c4e326d0fa8b514b79c68639b7abc1d85 #2997
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Windows Native VST3 Host | |
| # Dispatcher uses the reviewed main workflow and checks out the exact PR SHA. | |
| # The run name is a verifiable deduplication identity (not github.head_sha, | |
| # which would refer to main for workflow_dispatch on main). | |
| run-name: "ArSonMix ${{ github.event_name == 'workflow_dispatch' && inputs.package_fat && 'FAT' || github.event_name == 'workflow_dispatch' && inputs.field_preview && 'FIELD' || github.event_name == 'workflow_dispatch' && 'NATIVE' || 'AUTO' }} PR${{ inputs.request_pr_number || '0' }} ${{ inputs.expected_sha || github.sha }}" | |
| on: | |
| # Single canonical Windows release producer: main changes to shipped runtime, | |
| # native C++ or distribution scripts. Historical feature branch pushes are PRs. | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'CMakeLists.txt' | |
| - 'integration/console-v6/**' | |
| # Native headers may live outside console-v6 (M3 readback/ABI). | |
| - 'integration/*.h' | |
| - 'integration/*.hpp' | |
| - 'integration/*.cpp' | |
| - 'integration/**/*.h' | |
| - 'integration/**/*.hpp' | |
| - 'integration/**/*.cpp' | |
| - 'src/**' | |
| - 'web/approved-native-bridge.js' | |
| - 'web/approved-native-contract.js' | |
| - 'tests/approved_native_m2_contract.test.cjs' | |
| - 'scripts/build_approved_native_gui.py' | |
| - 'tests/approved_native_gui_bundle_test.py' | |
| - 'engine/**' | |
| # Only the native WebView bridge can trigger Windows; pure GUI/CSS uses Chromium + Pages. | |
| - 'web/bridge.js' | |
| - 'web/monitor.js' | |
| - 'tests/*.cpp' | |
| - 'scripts/package_native_windows.ps1' | |
| - 'scripts/build_verify_windows_installer.ps1' | |
| - 'installer/**' | |
| - 'tests/windows_installer_contract_test.mjs' | |
| - 'tests/fixtures/installer_graceful_close.cs' | |
| - 'scripts/verify_native_windows_artifact.ps1' | |
| - 'scripts/collect_hardware_fat_windows.ps1' | |
| - 'scripts/console_v6_fat_gate.mjs' | |
| - 'scripts/verify_console_s0_native_fixture.mjs' | |
| - 'scripts/run_console_native_s0.mjs' | |
| - 'scripts/check_console_puzzle.mjs' | |
| - 'scripts/check_approved_native_gui_release.mjs' | |
| - 'scripts/check_pr278_console_authority.mjs' | |
| - 'scripts/m3e_fat_evidence_gate.mjs' | |
| - 'scripts/factoryfx_release_bundle.py' | |
| - 'config/factoryfx-approved-releases.json' | |
| - 'config/factoryfx-notices/**' | |
| - 'scripts/tests/test_factoryfx_release_bundle.py' | |
| - '.github/workflows/p1-windows.yml' | |
| # Direct path scoped native qualification, without a second Windows call | |
| # from the UI workflow or historical multi-agent coordination. | |
| pull_request: | |
| types: [opened, reopened, synchronize, ready_for_review, converted_to_draft] | |
| paths: | |
| - 'CMakeLists.txt' | |
| - 'integration/console-v6/**' | |
| - 'integration/*.h' | |
| - 'integration/*.hpp' | |
| - 'integration/*.cpp' | |
| - 'integration/**/*.h' | |
| - 'integration/**/*.hpp' | |
| - 'integration/**/*.cpp' | |
| - 'src/**' | |
| - 'web/approved-native-bridge.js' | |
| - 'web/approved-native-contract.js' | |
| - 'tests/approved_native_m2_contract.test.cjs' | |
| - 'scripts/build_approved_native_gui.py' | |
| - 'tests/approved_native_gui_bundle_test.py' | |
| - 'engine/**' | |
| - 'web/bridge.js' | |
| - 'web/monitor.js' | |
| - 'tests/*.cpp' | |
| - 'scripts/package_native_windows.ps1' | |
| - 'scripts/build_verify_windows_installer.ps1' | |
| - 'installer/**' | |
| - 'tests/windows_installer_contract_test.mjs' | |
| - 'tests/fixtures/installer_graceful_close.cs' | |
| - 'scripts/verify_native_windows_artifact.ps1' | |
| - 'scripts/collect_hardware_fat_windows.ps1' | |
| - 'scripts/console_v6_fat_gate.mjs' | |
| - 'scripts/verify_console_s0_native_fixture.mjs' | |
| - 'scripts/run_console_native_s0.mjs' | |
| - 'scripts/check_console_puzzle.mjs' | |
| - 'scripts/check_approved_native_gui_release.mjs' | |
| - 'scripts/check_pr278_console_authority.mjs' | |
| - 'scripts/m3e_fat_evidence_gate.mjs' | |
| - 'scripts/factoryfx_release_bundle.py' | |
| - 'config/factoryfx-approved-releases.json' | |
| - 'config/factoryfx-notices/**' | |
| - 'scripts/tests/test_factoryfx_release_bundle.py' | |
| - '.github/workflows/p1-windows.yml' | |
| - 'tests/live_graph_contract_test.mjs' | |
| - 'tests/*native*contract*.mjs' | |
| workflow_dispatch: | |
| inputs: | |
| package_fat: | |
| description: "Package, verify and upload experimental Windows FAT ZIP" | |
| type: boolean | |
| required: false | |
| default: false | |
| field_preview: | |
| description: "Build the portable app for real Windows testing without the full CTest or installer suite" | |
| type: boolean | |
| required: false | |
| default: false | |
| focused_harmony_fat: | |
| description: "Focused Windows FAT for the built-in vocal harmony plugin: full app, plugin DSP, mixer PCM and ASIO checks" | |
| type: boolean | |
| required: false | |
| default: false | |
| expected_sha: | |
| description: "Immutable source SHA for ChatGPT milestone" | |
| type: string | |
| required: false | |
| default: "" | |
| request_pr_number: | |
| description: "Verified source PR number supplied only by the owner dispatcher (for per-PR deduplication)" | |
| type: string | |
| required: false | |
| default: "" | |
| concurrency: | |
| # Preserve immutable FAT uploads. Multiple non-FAT Windows requests from | |
| # the same PR share one slot and supersede each other; different PRs never | |
| # cancel one another. The owner dispatcher separately cancels an obsolete | |
| # native compile when a FAT request arrives for that same verified PR. | |
| group: windows-vst3-${{ github.event_name == 'workflow_dispatch' && inputs.package_fat && github.run_id || github.event_name == 'workflow_dispatch' && inputs.request_pr_number != '' && format('{0}-pr-{1}', inputs.field_preview && 'field' || 'native', inputs.request_pr_number) || github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: ${{ github.event_name != 'workflow_dispatch' || !inputs.package_fat }} | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| jobs: | |
| quick: | |
| name: Fast native contracts (no Windows / JUCE checkout) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 8 | |
| outputs: | |
| native_required: ${{ steps.native_scope.outputs.native_required }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ inputs.expected_sha != '' && inputs.expected_sha || github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} | |
| - name: Scope main CI-only changes without bypassing real native changes | |
| id: native_scope | |
| shell: bash | |
| env: | |
| BEFORE_SHA: ${{ github.event.before }} | |
| run: | | |
| set -euo pipefail | |
| required=true | |
| # Manual FAT/native is ALWAYS full. On a main push, only this exact | |
| # reviewed CI-control file allowlist may skip the expensive compiler. | |
| # Unknown/invalid/incomplete git history fails closed to full MSVC. | |
| if [[ "$GITHUB_EVENT_NAME" == 'push' && | |
| "$BEFORE_SHA" =~ ^[0-9a-f]{40}$ ]]; then | |
| if git fetch --no-tags --depth=2 origin "$BEFORE_SHA" >/dev/null 2>&1; then | |
| mapfile -t changed < <(git diff --name-only "$BEFORE_SHA" HEAD) | |
| if (( ${#changed[@]} > 0 )); then | |
| required=false | |
| for file in "${changed[@]}"; do | |
| case "$file" in | |
| .github/workflows/p1-windows.yml|scripts/chat_ci_dispatch.mjs|tests/chat_ci_dispatch_contract.test.mjs|tests/ci_workflow_efficiency_test.mjs|docs/SMART_CI_RUNNER_WORKFLOW.md) ;; | |
| *) required=true; break ;; | |
| esac | |
| done | |
| fi | |
| fi | |
| fi | |
| echo "native_required=$required" >> "$GITHUB_OUTPUT" | |
| echo "MAIN_NATIVE_GATE=$required" | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Catch broken native UI / CI contracts before a paid Windows runner | |
| run: | | |
| node scripts/check_console_puzzle.mjs | |
| node --check web/approved-native-bridge.js | |
| node --check web/approved-native-contract.js | |
| node --test --test-name-pattern="ASIO4ALL|ASIO restart" tests/mixer_io_operator_contract_test.mjs | |
| g++ -std=c++20 -O2 -Wall -Wextra -Werror tests/first_run_endpoint_policy_test.cpp -o "$RUNNER_TEMP/armix-first-run-policy" | |
| "$RUNNER_TEMP/armix-first-run-policy" | |
| node --test tests/native_first_run_bootstrap_contract.test.mjs | |
| node --test tests/rc_operator_workflow_contract.test.mjs tests/workstream_coordination_contract.test.mjs tests/ci_workflow_efficiency_test.mjs tests/chat_ci_dispatch_contract.test.mjs tests/approved_native_m2_contract.test.cjs tests/native_artifact_packaging_contract.test.mjs tests/windows_installer_contract_test.mjs tests/live_graph_contract_test.mjs tests/native_caption_wire_geometry_contract.test.cjs | |
| # Simulate Windows CP1252 before allocating MSVC: the native | |
| # inspector Python child must explicitly select UTF-8. | |
| PYTHONIOENCODING=cp1252 node --test --test-name-pattern="WIRE inspector controls PRIMARY BUS" tests/approved_native_m2_contract.test.cjs | |
| python -m unittest discover -s tests -p approved_native_gui_bundle_test.py -v | |
| python -m unittest discover -s scripts/tests -p test_factoryfx_release_bundle.py -v | |
| # Portable ChannelId PCM routing MUST be checked in under a minute, | |
| # before allocating a Windows JUCE/MSVC runner (93-CTest suite). | |
| - name: Native ChannelId pre/post and fader PCM golden (Linux no JUCE) | |
| run: | | |
| g++ -std=c++20 -O2 -Wall -Wextra -Werror tests/mixer_routing_plan_test.cpp -o "$RUNNER_TEMP/armix-native-routing-pcm" | |
| "$RUNNER_TEMP/armix-native-routing-pcm" | |
| - name: WaveShell JUCE 8 class-index regression (source-aware) | |
| shell: bash | |
| run: | | |
| # Trusted main workflow can test an older exact-PR SHA that | |
| # predates this VST3 patch. Do not pretend it passed a test it | |
| # never had. If the patch is in source, its test is mandatory. | |
| if [[ -f scripts/patch_juce_vst3_waveshell.py ]]; then | |
| if [[ ! -f tests/test_waveshell_juce_patch.py ]]; then | |
| echo 'WAVESHELL_SOURCE_TEST_MISSING: patch present without regression' >&2 | |
| exit 1 | |
| fi | |
| python -m unittest discover -s tests -p test_waveshell_juce_patch.py -v | |
| else | |
| if [[ -f tests/test_waveshell_juce_patch.py ]]; then | |
| echo 'WAVESHELL_SOURCE_PATCH_MISSING: regression without patch' >&2 | |
| exit 1 | |
| fi | |
| echo 'WAVESHELL_CHECK_NOT_IN_EXACT_SOURCE: historical pre-patch candidate' | |
| fi | |
| - name: Compressor exact-source native CPU A/B (same runner, non-gating timing) | |
| if: ${{ github.event_name == 'pull_request' && startsWith(github.head_ref, 'perf/compressor-') }} | |
| run: python scripts/benchmark_compressor_ab.py --reference 043748a552e66fd72e217cbf66aa35e6cc3e0b21 | |
| - name: Compressor standalone C++ compile + PCM regression (before MSVC) | |
| if: ${{ github.event_name == 'pull_request' && startsWith(github.head_ref, 'perf/compressor-') }} | |
| run: | | |
| g++ -std=c++20 -O2 -DNDEBUG -fno-fast-math tests/builtin_channel_compressor_test.cpp -o "$RUNNER_TEMP/native-compressor-core-test" | |
| "$RUNNER_TEMP/native-compressor-core-test" | |
| - name: Compressor standalone core lifecycle C++ test (cheap preflight) | |
| if: ${{ github.event_name == 'pull_request' && startsWith(github.head_ref, 'fix/compressor-') }} | |
| run: | | |
| g++ -std=c++20 -O2 -DNDEBUG -fno-fast-math tests/builtin_channel_compressor_test.cpp -o "$RUNNER_TEMP/native-compressor-core-test" | |
| "$RUNNER_TEMP/native-compressor-core-test" | |
| # Catch DSP recovery failures in seconds, before any exact-SHA MSVC | |
| # qualification. Portable core tests intentionally exclude JUCE. | |
| - name: Vocal Throw portable native C++ DSP / beat relock regression | |
| if: ${{ github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/arson-vocal-throw-') }} | |
| run: | | |
| g++ -std=c++20 -O2 -DNDEBUG -fno-fast-math tests/native_music_tempo_test.cpp -o "$RUNNER_TEMP/native-music-tempo-test" | |
| "$RUNNER_TEMP/native-music-tempo-test" | |
| g++ -std=c++20 -O2 -DNDEBUG -fno-fast-math tests/builtin_vocal_throw_test.cpp -o "$RUNNER_TEMP/native-vocal-throw-test" | |
| "$RUNNER_TEMP/native-vocal-throw-test" | |
| windows-build: | |
| name: Windows MSVC / realtime CTest | |
| needs: quick | |
| # Draft commits never reserve expensive Windows runners. Non-draft PR | |
| # synchronizations re-test latest HEAD. Main push and manual always run. | |
| # A main push containing ONLY CI policy/contract files was already | |
| # checked by the Linux native gate. Any runtime/native or unknown diff | |
| # still performs full MSVC/CTest. Owner-dispatched runs always compile. | |
| if: ${{ github.event_name != 'pull_request' && (github.event_name != 'push' || needs.quick.outputs.native_required == 'true') }} | |
| runs-on: windows-2022 | |
| timeout-minutes: 50 | |
| env: | |
| # Owner-dispatched FAT on an isolated Harmony-only PR can skip | |
| # compiling unrelated CTest executables, never the actual JUCE GUI. | |
| # Main/release builds and every generic native milestone remain full. | |
| FIELD_PREVIEW: ${{ github.event_name == 'workflow_dispatch' && inputs.field_preview && !inputs.package_fat }} | |
| FOCUSED_HARMONY_FAT: ${{ github.event_name == 'workflow_dispatch' && inputs.package_fat == true && inputs.focused_harmony_fat == true }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| # Package the actual PR branch commit, NOT the synthetic PR merge. | |
| ref: ${{ inputs.expected_sha != '' && inputs.expected_sha || github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} | |
| - name: Verify exact source SHA before native CTest / optional FAT ZIP | |
| shell: pwsh | |
| env: | |
| EXPECTED_SOURCE_SHA: ${{ inputs.expected_sha != '' && inputs.expected_sha || github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} | |
| run: | | |
| $actual = (& git rev-parse HEAD).Trim() | |
| if ($LASTEXITCODE -ne 0 -or $actual -ne $env:EXPECTED_SOURCE_SHA) { | |
| throw "FAT_SOURCE_HEAD_MISMATCH expected=$env:EXPECTED_SOURCE_SHA actual=$actual" | |
| } | |
| Write-Host "FAT_EXACT_PR_HEAD_CHECKOUT=$actual" | |
| - name: Cheap canonical Console v6 puzzle socket gate (no JUCE) | |
| run: node scripts/check_console_puzzle.mjs | |
| - name: Stop incomplete integrated product promotion before JUCE checkout | |
| if: ${{ github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-') }} | |
| run: node scripts/check_console_puzzle.mjs --release | |
| - name: Fast offline FactoryFX release and integrity contract tests | |
| shell: pwsh | |
| run: | | |
| python -m unittest discover -s scripts/tests -p test_factoryfx_release_bundle.py -v | |
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | |
| - name: Check approved Pages GUI provenance before costly JUCE checkout | |
| shell: pwsh | |
| run: | | |
| python -m unittest discover -s tests -p approved_native_gui_bundle_test.py -v | |
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | |
| - name: Checkout JUCE 8 pinned | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: juce-framework/JUCE | |
| ref: 8.0.15 | |
| path: third_party/JUCE | |
| - name: Install WebView2 SDK for JUCE | |
| shell: pwsh | |
| run: nuget install Microsoft.Web.WebView2 -Version 1.0.3485.44 -OutputDirectory .deps -NonInteractive | |
| - name: Validate native UI JavaScript | |
| shell: pwsh | |
| run: | | |
| # Do not hide earlier Node failures with the exit code of the LAST | |
| # command. One Node invocation also avoids repeated startup costs. | |
| foreach ($file in @('web/bridge.js', 'web/plugin-ui.js', 'web/monitor.js', 'web/app.js', 'web/mixer-io.js', 'web/mixer-layout.js', 'web/approved-native-contract.js', 'web/approved-native-bridge.js')) { | |
| node --check $file | |
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | |
| } | |
| $contracts = @( | |
| 'tests/workstream_coordination_contract.test.mjs' | |
| 'tests/gui_workflow_contract_test.mjs' | |
| 'tests/approved_native_m2_contract.test.cjs' | |
| 'tests/native_ui_contract_test.mjs' | |
| 'tests/native_preset_contract_test.mjs' | |
| 'tests/fx_add_contract_test.mjs' | |
| 'tests/fx_drag_reorder_contract_test.mjs' | |
| 'tests/live_graph_contract_test.mjs' | |
| 'tests/reconciled_gui_engine_contract_test.mjs' | |
| 'tests/main_v08_native_integration_test.mjs' | |
| 'tests/smart_audio_ard_contract_test.mjs' | |
| 'tests/p0_diagnostic_contract_test.mjs' | |
| 'tests/smart_audio_diagnostic_contract_test.mjs' | |
| 'tests/independent_clock_adapter_contract_test.mjs' | |
| 'tests/direct_restore_recovery_contract_test.mjs' | |
| 'tests/native_artifact_packaging_contract_test.mjs' | |
| 'tests/windows_installer_contract_test.mjs' | |
| 'tests/portable_workspace_contract_test.mjs' | |
| 'tests/plugin_vault_contract_test.mjs' | |
| 'tests/plugin_ui_contract_test.mjs' | |
| 'tests/live_routing_ui_contract_test.mjs' | |
| 'tests/mixer_io_operator_contract_test.mjs' | |
| 'tests/mixer_shell_contract_test.mjs' | |
| 'tests/studio_backup_contract_test.mjs' | |
| ) | |
| node --test $contracts | |
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | |
| - name: Configure Windows x64 | |
| shell: pwsh | |
| run: > | |
| cmake -S . -B build -G "Visual Studio 17 2022" -A x64 | |
| -DJUCE_ROOT="${{ github.workspace }}/third_party/JUCE" | |
| -DBUILD_TESTING=${{ env.FIELD_PREVIEW == 'true' && 'OFF' || 'ON' }} | |
| -DJUCE_WEBVIEW2_PACKAGE_LOCATION="${{ github.workspace }}/.deps" | |
| - name: Verify exact ONE approved /preview/ GUI CMake bundle | |
| run: node scripts/check_approved_native_gui_release.mjs --source-only --bundle build/approved_gui | |
| # Manual FAT scoped to the vocal harmony plugin must compile the actual | |
| # app plus DSP/PCM/ASIO boundary probes, not 70+ unrelated fixtures. | |
| # The CTest phase took ~8 sec in a full 80-test Windows run while its | |
| # full compilation took ~18 min. This is a build cost optimization, | |
| # NOT permission to skip the full CTest gate before release. | |
| - name: Build JUCE app and focused vocal harmony, mixer and ASIO tests | |
| if: ${{ env.FOCUSED_HARMONY_FAT == 'true' }} | |
| shell: pwsh | |
| run: | | |
| $targets = @( | |
| 'ARMixConsole' | |
| 'ARMixHarmonyOfflineAb' | |
| 'ARMixHarmonyPitchSyncTests' | |
| 'ARMixHarmonySpatialTests' | |
| 'ARMixHarmonyDspTests' | |
| 'ARMixHarmonyCpuProfileTests' | |
| 'ARMixHarmonyMusicGuideTests' | |
| 'ARMixHarmonyChannelPcmTests' | |
| 'ARMixHarmonyBypassPcmTests' | |
| 'ARMixCrackleWindowTests' | |
| 'ARMixNativeMixerSessionTests' | |
| 'ARMixLiveChannelFxTests' | |
| ) | |
| # Check exact source first: a long-lived vocal harmony plugin PR can have an | |
| # older CMakeLists.txt than the trusted CI YAML from main. | |
| # Fail before compiling JUCE if the mandatory test registry drifts. | |
| $catalogText = & ctest --test-dir build -C Release --show-only=json-v1 | |
| if ($LASTEXITCODE -ne 0) { throw 'Focused FAT cannot read source CTest registry' } | |
| $catalog = ($catalogText | Out-String | ConvertFrom-Json) | |
| $available = @($catalog.tests | ForEach-Object { $_.name }) | |
| $required = @( | |
| 'NativeHarmonyOfflineDryAndABRenderHarness' | |
| 'NativeHarmonyPitchSynchronousFormantCandidateAndBlockParity' | |
| 'NativeHarmonyBackingStageSpatialDepthAndMonoPDC' | |
| 'NativeHarmonyMultivoicePitchAndRealtimeFinitePCM' | |
| 'NativeHarmonySyntheticCallbackCpuProfile' | |
| 'NativeHarmonyCrossChannelMusicKeyAndManualFallback' | |
| 'NativeHarmonyMusicFromOtherChannelIdAndStateMigration' | |
| 'NativeHarmonyWarmBypassRackSlotAndLatencyParity' | |
| 'ApprovedNativeHarmonyEditorAckAndSingleGui' | |
| 'P0PreMarkerFiveSecondEvidenceWindow' | |
| 'P1FPhysicalPortToNativeMasterAndEpochGuard' | |
| 'P1HRealNativePerChannelFxAndSafeRetirement' | |
| ) | |
| $missing = @($required | Where-Object { $_ -notin $available }) | |
| if ($missing.Count -gt 0) { | |
| throw "FOCUSED_FAT_MISSING_REQUIRED_TESTS=$($missing -join ',')" | |
| } | |
| # The production render audit exists in newer CMake but not in | |
| # older vocal harmony plugin candidates. Run it when source declares it. | |
| if ('M3ActualProductionRenderPathAndFailSilentCounters' -in $available) { | |
| $targets += 'ARMixProductionRenderAuditTests' | |
| Write-Host 'FOCUSED_FAT_PRODUCTION_AUDIT=in-source' | |
| } else { | |
| Write-Host 'FOCUSED_FAT_PRODUCTION_AUDIT=not-in-source' | |
| } | |
| $cmakeSource = Get-Content -LiteralPath 'CMakeLists.txt' -Raw | |
| foreach ($target in $targets) { | |
| $escaped = [regex]::Escape($target) | |
| if ($cmakeSource -notmatch "(?m)^\s*(?:add_executable|juce_add_console_app|juce_add_gui_app)\(\s*$escaped\b") { | |
| throw "FOCUSED_FAT_UNDECLARED_CMAKE_TARGET=$target" | |
| } | |
| } | |
| & cmake --build build --config Release --parallel 2 --target $targets | |
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | |
| # github.sha is the trusted workflow ref when dispatched from main, | |
| # not the source commit of a long-lived candidate PR. | |
| $sourceSha = (& git rev-parse HEAD).Trim() | |
| if ($LASTEXITCODE -ne 0 -or $sourceSha -ne '${{ inputs.expected_sha }}') { | |
| throw "HARMONY_FAT_SOURCE_SHA_MISMATCH expected=${{ inputs.expected_sha }} actual=$sourceSha" | |
| } | |
| Write-Host "HARMONY_FAT_NATIVE_TARGETS=$($targets.Count) SOURCE_SHA=$sourceSha" | |
| - name: Build executable and native RT tests | |
| if: ${{ env.FOCUSED_HARMONY_FAT != 'true' && env.FIELD_PREVIEW != 'true' }} | |
| # Full build remains mandatory for main, release and native/full requests. | |
| run: cmake --build build --config Release --parallel 2 | |
| - name: Run focused vocal harmony DSP, mixer PCM and ASIO checks | |
| if: ${{ env.FOCUSED_HARMONY_FAT == 'true' }} | |
| shell: pwsh | |
| run: | | |
| $requiredTests = @( | |
| 'NativeHarmonyOfflineDryAndABRenderHarness' | |
| 'NativeHarmonyPitchSynchronousFormantCandidateAndBlockParity' | |
| 'NativeHarmonyBackingStageSpatialDepthAndMonoPDC' | |
| 'NativeHarmonyMultivoicePitchAndRealtimeFinitePCM' | |
| 'NativeHarmonySyntheticCallbackCpuProfile' | |
| 'NativeHarmonyCrossChannelMusicKeyAndManualFallback' | |
| 'NativeHarmonyMusicFromOtherChannelIdAndStateMigration' | |
| 'NativeHarmonyWarmBypassRackSlotAndLatencyParity' | |
| 'ApprovedNativeHarmonyEditorAckAndSingleGui' | |
| 'P0PreMarkerFiveSecondEvidenceWindow' | |
| 'P1FPhysicalPortToNativeMasterAndEpochGuard' | |
| 'P1HRealNativePerChannelFxAndSafeRetirement' | |
| ) | |
| # GitHub/CTest can exit 0 when -R matches zero tests. Fail closed | |
| # if a refactor renamed a test without updating this focused lane. | |
| $catalog = (& ctest --test-dir build -C Release --show-only=json-v1 | Out-String | ConvertFrom-Json) | |
| if ($LASTEXITCODE -ne 0) { throw 'Unable to read native CTest catalog' } | |
| $available = @($catalog.tests | ForEach-Object { $_.name }) | |
| $missing = @($requiredTests | Where-Object { $_ -notin $available }) | |
| if ($missing.Count -ne 0) { | |
| throw "FOCUSED_FAT_MISSING_REQUIRED_TESTS=$($missing -join ',')" | |
| } | |
| if ('M3ActualProductionRenderPathAndFailSilentCounters' -in $available) { | |
| $requiredTests += 'M3ActualProductionRenderPathAndFailSilentCounters' | |
| } | |
| $pattern = '^(' + (($requiredTests | ForEach-Object { [regex]::Escape($_) }) -join '|') + ')$' | |
| Write-Host "FOCUSED_HARMONY_FAT_CTEST_COUNT=$($requiredTests.Count) FULL_SUITE_NOT_CLAIMED" | |
| & ctest --test-dir build -C Release --output-on-failure -R $pattern | |
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | |
| - name: Build portable Windows field preview | |
| if: ${{ env.FIELD_PREVIEW == 'true' }} | |
| run: cmake --build build --config Release --parallel 2 --target ARMixConsole | |
| - name: Test realtime control primitives | |
| if: ${{ env.FOCUSED_HARMONY_FAT != 'true' && env.FIELD_PREVIEW != 'true' }} | |
| run: ctest --test-dir build -C Release --output-on-failure | |
| - name: Package verified JUCE GUI for hardware FAT | |
| if: ${{ env.FIELD_PREVIEW == 'true' || (github.event_name == 'workflow_dispatch' && inputs.package_fat == true) }} | |
| shell: pwsh | |
| run: | | |
| & ./scripts/package_native_windows.ps1 -BuildDir build -OutputDir dist | |
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | |
| - name: Stage ONLY legally approved and host-qualified Factory VST3 bundles | |
| if: ${{ env.FIELD_PREVIEW == 'true' || (github.event_name == 'workflow_dispatch' && inputs.package_fat == true) }} | |
| shell: pwsh | |
| run: | | |
| python scripts/factoryfx_release_bundle.py stage --lock config/factoryfx-approved-releases.json --output dist --best-effort | |
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | |
| - name: Mark unqualified field preview BEFORE independent distribution verification | |
| if: ${{ env.FIELD_PREVIEW == 'true' }} | |
| shell: pwsh | |
| run: | | |
| # Tag the final allowlisted package rather than modifying files | |
| # AFTER verification. Users receive exactly the bytes we validate. | |
| $path = 'dist/BUILD_PROVENANCE.json' | |
| $provenance = Get-Content -LiteralPath $path -Raw -Encoding UTF8 | ConvertFrom-Json | |
| if ($provenance.sourceCommit -ne '${{ inputs.expected_sha }}') { | |
| throw 'FIELD_PREVIEW_SOURCE_SHA_MISMATCH' | |
| } | |
| $provenance.fatStatus = 'FIELD_PREVIEW_FULL_CTEST_NOT_RUN' | |
| $provenance | ConvertTo-Json -Depth 20 | | |
| Set-Content -LiteralPath $path -Encoding utf8 | |
| - name: Independently verify release ZIP and embedded GUI/engine before upload | |
| if: ${{ env.FIELD_PREVIEW == 'true' || (github.event_name == 'workflow_dispatch' && inputs.package_fat == true) }} | |
| shell: pwsh | |
| run: | | |
| & ./scripts/verify_native_windows_artifact.ps1 -OutputDir dist | |
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | |
| - name: Upload portable Windows field preview | |
| if: ${{ env.FIELD_PREVIEW == 'true' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ArSonMix-Windows-Field-Preview-${{ inputs.expected_sha }} | |
| path: dist/ | |
| if-no-files-found: error | |
| retention-days: 14 | |
| compression-level: 0 | |
| - name: Install Inno Setup 6 compiler if missing | |
| if: ${{ github.event_name == 'workflow_dispatch' && inputs.package_fat == true }} | |
| shell: pwsh | |
| run: | | |
| if (-not (Get-Command ISCC.exe -ErrorAction SilentlyContinue) -and | |
| -not (Test-Path -LiteralPath 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe')) { | |
| choco install innosetup --yes --no-progress --limit-output | |
| if ($LASTEXITCODE -ne 0) { throw 'Inno Setup compiler installation failed' } | |
| } | |
| - name: Compile and validate per-user Windows RC installer from exact FAT PE | |
| if: ${{ github.event_name == 'workflow_dispatch' && inputs.package_fat == true }} | |
| shell: pwsh | |
| run: | | |
| & ./scripts/build_verify_windows_installer.ps1 -OutputDir dist -InstallerOutput installer-output | |
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | |
| # One opt-in exact-SHA FAT: genuine published alpha.4 -> alpha.5 -> | |
| # alpha.4 rollback, always on a disposable GitHub Windows runner. | |
| # Never executed by ordinary PR/push, never on a user's workstation. | |
| - name: Prove two authentic historical Inno releases upgrade and roll back | |
| if: ${{ github.event_name == 'workflow_dispatch' && inputs.package_fat == true }} | |
| shell: pwsh | |
| env: | |
| # Per-job contents:read; do not forward to asset redirect URLs. | |
| GITHUB_TOKEN: ${{ github.token }} | |
| run: | | |
| & ./scripts/test_two_genuine_inno_releases_windows.ps1 | |
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | |
| # The expensive Windows compiler job terminates BEFORE the unreliable | |
| # artifact service. A byte-authenticated, run-unique Actions cache handoff | |
| # lets a failed upload job be retried by itself (no MSVC/CTest rebuild). | |
| - name: Seal exact-SHA FAT delivery payload after all installer tests | |
| if: ${{ github.event_name == 'workflow_dispatch' && inputs.package_fat == true }} | |
| shell: pwsh | |
| env: | |
| FAT_SOURCE_SHA: ${{ inputs.expected_sha }} | |
| run: | | |
| $ErrorActionPreference='Stop' | |
| $actual=(& git rev-parse HEAD).Trim() | |
| if($LASTEXITCODE -ne 0 -or $actual -ne $env:FAT_SOURCE_SHA){throw 'FAT_HANDOFF_SOURCE_MISMATCH'} | |
| $provenance=Get-Content -LiteralPath 'dist/BUILD_PROVENANCE.json' -Raw | ConvertFrom-Json | |
| $exe=Join-Path 'dist' $provenance.executable | |
| $setup='installer-output/ArSonMix-Windows-x64-Setup-Preview.exe' | |
| if($provenance.sourceCommit -ne $env:FAT_SOURCE_SHA -or | |
| $provenance.fatStatus -ne 'SOFTWARE_VERIFIED_PREVIEW_CANDIDATE' -or | |
| -not (Test-Path -LiteralPath $exe -PathType Leaf) -or | |
| -not (Test-Path -LiteralPath $setup -PathType Leaf) -or | |
| (Get-FileHash -LiteralPath $exe -Algorithm SHA256).Hash.ToLowerInvariant() -ne $provenance.exeSha256){ | |
| throw 'FAT_HANDOFF_PROVENANCE_INVALID' | |
| } | |
| $root=(Resolve-Path '.').Path | |
| $files=@(Get-ChildItem -LiteralPath 'dist','installer-output' -Recurse -File | | |
| Sort-Object FullName | ForEach-Object { | |
| [ordered]@{ | |
| path=$_.FullName.Substring($root.Length+1).Replace('\','/') | |
| bytes=$_.Length | |
| sha256=(Get-FileHash -LiteralPath $_.FullName -Algorithm SHA256).Hash.ToLowerInvariant() | |
| } | |
| }) | |
| if($files.Count -lt 5 -or $files.Count -gt 5000){throw 'FAT_HANDOFF_FILE_COUNT_INVALID'} | |
| [ordered]@{schema='arsonmix.ci-fat-handoff.v1';sourceSha=$env:FAT_SOURCE_SHA;files=$files} | | |
| ConvertTo-Json -Depth 5 | Set-Content -LiteralPath 'delivery-receipt.json' -Encoding UTF8 | |
| Write-Host "FAT_CACHE_SEALED source=$actual files=$($files.Count)" | |
| - name: Save completed FAT packages for retryable upload job | |
| if: ${{ github.event_name == 'workflow_dispatch' && inputs.package_fat == true }} | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: | | |
| dist/ | |
| installer-output/ | |
| delivery-receipt.json | |
| key: arsonmix-fat-delivery-v1-${{ inputs.expected_sha }}-${{ github.run_id }} | |
| # Upload is separate from the 30-minute Windows compiler + 92 CTests. | |
| # If GitHub returns HTML instead of JSON (observed at 43094957798), | |
| # retry ONLY this job; the completed build is preserved in the immutable | |
| # run-unique cache key and all bytes are re-hashed before publish. | |
| fat-upload: | |
| name: Publish verified Windows FAT artifacts (retry without recompiling) | |
| needs: windows-build | |
| if: ${{ github.event_name == 'workflow_dispatch' && inputs.package_fat == true }} | |
| runs-on: windows-2022 | |
| timeout-minutes: 16 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ inputs.expected_sha }} | |
| - name: Restore the immutable, completed same-run FAT payload | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| dist/ | |
| installer-output/ | |
| delivery-receipt.json | |
| key: arsonmix-fat-delivery-v1-${{ inputs.expected_sha }}-${{ github.run_id }} | |
| fail-on-cache-miss: true | |
| - name: Re-verify every FAT cache byte and original source provenance | |
| shell: pwsh | |
| env: | |
| FAT_SOURCE_SHA: ${{ inputs.expected_sha }} | |
| run: | | |
| $ErrorActionPreference='Stop' | |
| $actual=(& git rev-parse HEAD).Trim() | |
| if($LASTEXITCODE -ne 0 -or $actual -ne $env:FAT_SOURCE_SHA){throw 'FAT_UPLOAD_CHECKOUT_MISMATCH'} | |
| $receipt=Get-Content -LiteralPath 'delivery-receipt.json' -Raw | ConvertFrom-Json | |
| if($receipt.schema -ne 'arsonmix.ci-fat-handoff.v1' -or $receipt.sourceSha -ne $actual) { | |
| throw 'FAT_UPLOAD_RECEIPT_MISMATCH' | |
| } | |
| $root=(Resolve-Path '.').Path | |
| $actualFiles=@(Get-ChildItem -LiteralPath 'dist','installer-output' -Recurse -File | | |
| Sort-Object FullName) | |
| if($actualFiles.Count -ne @($receipt.files).Count -or $actualFiles.Count -lt 5) { | |
| throw 'FAT_UPLOAD_FILE_LIST_MISMATCH' | |
| } | |
| for($i=0;$i -lt $actualFiles.Count;$i++){ | |
| $file=$actualFiles[$i] | |
| $relative=$file.FullName.Substring($root.Length+1).Replace('\','/') | |
| $expected=$receipt.files[$i] | |
| if($relative -cne $expected.path -or $file.Length -ne $expected.bytes -or | |
| (Get-FileHash -LiteralPath $file.FullName -Algorithm SHA256).Hash.ToLowerInvariant() -cne $expected.sha256){ | |
| throw "FAT_UPLOAD_HASH_MISMATCH: $relative" | |
| } | |
| } | |
| $provenance=Get-Content -LiteralPath 'dist/BUILD_PROVENANCE.json' -Raw | ConvertFrom-Json | |
| $exe=Join-Path 'dist' $provenance.executable | |
| if($provenance.sourceCommit -ne $actual -or | |
| $provenance.fatStatus -ne 'SOFTWARE_VERIFIED_PREVIEW_CANDIDATE' -or | |
| (Get-FileHash -LiteralPath $exe -Algorithm SHA256).Hash.ToLowerInvariant() -cne $provenance.exeSha256 -or | |
| -not (Test-Path -LiteralPath 'installer-output/ArSonMix-Windows-x64-Setup-Preview.exe' -PathType Leaf)){ | |
| throw 'FAT_UPLOAD_EXE_OR_SETUP_INVALID' | |
| } | |
| Write-Host "FAT_CACHE_REVALIDATED exact_sha=$actual files=$($actualFiles.Count)" | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ArSonMix-Windows-Installer-Preview-${{ github.run_id }} | |
| path: installer-output/ | |
| if-no-files-found: error | |
| retention-days: 14 | |
| compression-level: 0 | |
| overwrite: true | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ArSonMix-Windows-FAT-Preview-${{ github.run_id }} | |
| path: dist/ | |
| if-no-files-found: error | |
| retention-days: 14 | |
| compression-level: 0 | |
| overwrite: true |