✨ Add browser bridge named-pipe server #88
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: build | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: build | |
| runs-on: windows-latest | |
| env: | |
| VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | |
| steps: | |
| - name: Export GitHub Actions cache variables | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | |
| core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Check formatting (clang-format) | |
| shell: pwsh | |
| run: | | |
| $targets = @() | |
| $targets += Get-ChildItem -Path src -Include *.cpp,*.hpp -Recurse -File -ErrorAction SilentlyContinue | |
| $targets += Get-ChildItem -Path tests -Include *.cpp,*.hpp -Recurse -File -ErrorAction SilentlyContinue | |
| foreach ($f in $targets) { | |
| Write-Host "Formatting $($f.FullName)" | |
| clang-format -i $f.FullName | |
| } | |
| $diff = git diff --name-only | |
| if ($diff) { | |
| Write-Host "::error::The following files need formatting:" | |
| Write-Host $diff | |
| exit 1 | |
| } | |
| Write-Host "All files are properly formatted." | |
| - name: Set up vcpkg | |
| uses: lukka/run-vcpkg@v11 | |
| with: | |
| vcpkgJsonGlob: vcpkg.json | |
| - name: Configure CMake | |
| run: > | |
| cmake -B build | |
| -G "Visual Studio 17 2022" -A x64 | |
| -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake | |
| -DVCPKG_TARGET_TRIPLET=x64-windows | |
| -DENABLE_TESTS=ON | |
| - name: Build | |
| run: cmake --build build --config Release --parallel | |
| - name: Stage artifact | |
| shell: pwsh | |
| run: | | |
| $src = "build/bin/Release" | |
| $dst = "artifact-staging/seal-windows-x64" | |
| New-Item -ItemType Directory -Force -Path $dst | Out-Null | |
| $excludeFiles = @( | |
| "*.pdb", "*.ilk", "*.exp", "*.lib", "*.idb", "*.obj", | |
| "seal_tests.exe", "gtest.dll", "gtest_main.dll" | |
| ) | |
| $excludeDirs = @("test", "CMakeFiles", "moc_*", "qrc_*") | |
| Copy-Item -Path "$src/*" -Destination $dst -Recurse -Force ` | |
| -Exclude $excludeFiles | |
| foreach ($d in $excludeDirs) { | |
| Get-ChildItem -Path $dst -Recurse -Directory -Filter $d ` | |
| -ErrorAction SilentlyContinue | | |
| Remove-Item -Recurse -Force -ErrorAction SilentlyContinue | |
| } | |
| Write-Host "Artifact contents:" | |
| Get-ChildItem -Path $dst -Recurse -File | | |
| Select-Object @{n="Path";e={$_.FullName.Substring((Resolve-Path $dst).Path.Length + 1)}}, @{n="SizeKB";e={[math]::Round($_.Length/1KB,1)}} | | |
| Sort-Object Path | | |
| Format-Table -AutoSize | |
| $total = (Get-ChildItem -Path $dst -Recurse -File | Measure-Object -Property Length -Sum).Sum | |
| Write-Host ("Total artifact size: {0:N1} MB" -f ($total / 1MB)) | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: seal-windows-x64-${{ github.sha }} | |
| path: artifact-staging/seal-windows-x64 | |
| if-no-files-found: error | |
| retention-days: 14 | |
| compression-level: 9 |