CI: wait for embedded WinExe smoke to exit cleanly #17
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: Rivet Windows Experiment | |
| on: | |
| push: | |
| branches: [experiment/taskly-rivet] | |
| paths: | |
| - 'apps/windows/**' | |
| - 'racket/**' | |
| - 'rivet.rktd' | |
| - '.github/workflows/rivet-windows.yml' | |
| pull_request: | |
| paths: | |
| - 'apps/windows/**' | |
| - 'racket/**' | |
| - 'rivet.rktd' | |
| - '.github/workflows/rivet-windows.yml' | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: rivet-windows-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| RIVET_COMMIT: fe01374f1219277e88a33801e8f3cef914e3e79f | |
| jobs: | |
| windows: | |
| name: WinUI Native + embedded Rivet | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Build native fallback mode | |
| shell: pwsh | |
| run: dotnet build apps/windows/Taskly/Taskly.csproj -c Release -p:Platform=x64 | |
| - name: Set up Racket CS | |
| uses: Bogdanp/setup-racket@v1.15 | |
| with: | |
| architecture: x64 | |
| distribution: full | |
| variant: CS | |
| version: '9.3' | |
| - name: Install pinned Rivet | |
| shell: pwsh | |
| run: | | |
| $rivet = Join-Path $env:RUNNER_TEMP 'rivet' | |
| git clone https://github.com/turinglambdaai/rivet.git $rivet | |
| git -C $rivet checkout $env:RIVET_COMMIT | |
| raco pkg install --auto --no-docs --name rivet --link $rivet | |
| "RIVET_ROOT=$rivet" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
| - name: Build Taskly embedded Racket bundle | |
| shell: pwsh | |
| run: raco rivet build-dotnet | |
| - name: Build WinUI Rivet mode | |
| shell: pwsh | |
| run: | | |
| dotnet clean apps/windows/Taskly/Taskly.csproj -c Release -p:Platform=x64 | |
| dotnet build apps/windows/Taskly/Taskly.csproj ` | |
| -c Release ` | |
| -p:Platform=x64 ` | |
| -p:UseRivetBackend=true ` | |
| -p:RivetRoot="$env:RIVET_ROOT" | |
| - name: Verify embedded runtime layout | |
| shell: pwsh | |
| run: | | |
| $exe = Get-ChildItem 'apps/windows/Taskly/bin' -Recurse -Filter 'Taskly.exe' | | |
| Sort-Object LastWriteTime -Descending | | |
| Select-Object -First 1 | |
| if ($null -eq $exe) { throw 'Taskly.exe was not produced' } | |
| $out = $exe.Directory.FullName | |
| if (-not (Test-Path (Join-Path $out 'rivet_native.dll'))) { | |
| throw 'rivet_native.dll is missing beside Taskly.exe' | |
| } | |
| $racket = Get-ChildItem $out -Filter '*racketcs*.dll' | Select-Object -First 1 | |
| if ($null -eq $racket) { throw 'Racket CS runtime DLL is missing beside Taskly.exe' } | |
| if (-not (Test-Path (Join-Path $out 'rivet/res/core.zo'))) { | |
| throw 'compiled Taskly Racket backend is missing from output' | |
| } | |
| foreach ($boot in @('petite.boot', 'scheme.boot', 'racket.boot')) { | |
| if (-not (Test-Path (Join-Path $out "rivet/runtime/$boot"))) { | |
| throw "$boot is missing from Taskly output" | |
| } | |
| } | |
| "TASKLY_RIVET_EXE=$($exe.FullName)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
| Write-Host "Embedded Taskly output: $out" | |
| - name: Run Taskly embedded runtime smoke | |
| shell: pwsh | |
| run: | | |
| # Taskly.exe is built as WinExe. PowerShell's direct invocation of a | |
| # GUI-subsystem executable may return before the process exits and | |
| # leave $LASTEXITCODE unset. Explicitly wait for the real process. | |
| $process = Start-Process ` | |
| -FilePath $env:TASKLY_RIVET_EXE ` | |
| -ArgumentList '__rivet-smoke' ` | |
| -Wait ` | |
| -PassThru | |
| if ($process.ExitCode -ne 0) { | |
| throw "Taskly embedded Rivet smoke failed with exit code $($process.ExitCode)" | |
| } | |
| Write-Host 'Taskly embedded Rivet smoke completed successfully.' |