Skip to content

Preserve attachment lifetime and native file semantics #52

Preserve attachment lifetime and native file semantics

Preserve attachment lifetime and native file semantics #52

Workflow file for this run

name: Native bridge builds
on: [push, pull_request, workflow_dispatch]
permissions:
contents: read
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-14]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Windows binding generator
if: runner.os == 'Windows'
shell: pwsh
run: |
python -m pip install libclang==18.1.1
$clang = python -c "import clang.cindex; print(clang.cindex.Config.library_path)"
"LIBCLANG_PATH=$clang" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: macOS build headers and library
if: runner.os == 'macOS'
run: |
brew install pkg-config
brew install --cask macfuse
echo "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/opt/homebrew/lib/pkgconfig" >> "$GITHUB_ENV"
- run: cargo build --locked
- run: cargo test --locked --workspace
- name: Install signed WinFsp runtime on the disposable runner
if: runner.os == 'Windows'
shell: pwsh
run: |
$msi = Join-Path $env:RUNNER_TEMP 'winfsp-2.1.25156.msi'
Invoke-WebRequest 'https://github.com/winfsp/winfsp/releases/download/v2.1/winfsp-2.1.25156.msi' -OutFile $msi
if ((Get-FileHash -Algorithm SHA256 -LiteralPath $msi).Hash -ne '073A70E00F77423E34BED98B86E600DEF93393BA5822204FAC57A29324DB9F7A') { throw 'WinFsp installer hash mismatch' }
$signature = Get-AuthenticodeSignature -LiteralPath $msi
if ($signature.Status -ne 'Valid' -or $signature.SignerCertificate.Subject -notmatch 'Navimatics') { throw 'WinFsp installer signature mismatch' }
$install = Start-Process msiexec.exe -ArgumentList @('/i', ('"' + $msi + '"'), '/qn', '/norestart', 'INSTALLLEVEL=1000') -WindowStyle Hidden -Wait -PassThru
if ($install.ExitCode -notin @(0, 3010)) { throw "WinFsp installation failed: $($install.ExitCode)" }
- name: Native Windows filesystem acceptance
if: runner.os == 'Windows'
timeout-minutes: 5
env:
SHELLCANVAS_NATIVE_WINDOWS_TEST: '1'
run: cargo test --locked --test native_windows -- --ignored --nocapture
- uses: actions/upload-artifact@v4
with:
name: drive-bridge-${{ runner.os }}
path: |
target/debug/shellcanvas-drive-bridge
target/debug/shellcanvas-drive-bridge.exe
if-no-files-found: error