|
| 1 | +name: Installer Smoke |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + paths: |
| 7 | + - "install-macos.sh" |
| 8 | + - "install-windows.ps1" |
| 9 | + - "pyproject.toml" |
| 10 | + - "setup.py" |
| 11 | + - "README.md" |
| 12 | + - "src/**" |
| 13 | + - ".github/workflows/installer-smoke.yml" |
| 14 | + pull_request: |
| 15 | + paths: |
| 16 | + - "install-macos.sh" |
| 17 | + - "install-windows.ps1" |
| 18 | + - "pyproject.toml" |
| 19 | + - "setup.py" |
| 20 | + - "README.md" |
| 21 | + - "src/**" |
| 22 | + - ".github/workflows/installer-smoke.yml" |
| 23 | + workflow_dispatch: |
| 24 | + |
| 25 | +permissions: |
| 26 | + contents: read |
| 27 | + |
| 28 | +jobs: |
| 29 | + macos-installer: |
| 30 | + name: macOS installer |
| 31 | + runs-on: macos-latest |
| 32 | + |
| 33 | + steps: |
| 34 | + - name: Check out repository |
| 35 | + uses: actions/checkout@v4 |
| 36 | + |
| 37 | + - name: Set up Python |
| 38 | + uses: actions/setup-python@v5 |
| 39 | + with: |
| 40 | + python-version: "3.13" |
| 41 | + |
| 42 | + - name: Run installer |
| 43 | + env: |
| 44 | + SLICER_URI_BRIDGE_PROJECT_SPEC: ${{ github.workspace }} |
| 45 | + HOME: ${{ runner.temp }}/home |
| 46 | + XDG_CONFIG_HOME: ${{ runner.temp }}/xdg-config |
| 47 | + URI_BRIDGE_MACOS_APP_DIR: ${{ runner.temp }}/Applications |
| 48 | + run: | |
| 49 | + mkdir -p "$HOME" "$XDG_CONFIG_HOME" "$URI_BRIDGE_MACOS_APP_DIR" |
| 50 | + bash install-macos.sh |
| 51 | +
|
| 52 | + - name: Verify installation |
| 53 | + env: |
| 54 | + HOME: ${{ runner.temp }}/home |
| 55 | + XDG_CONFIG_HOME: ${{ runner.temp }}/xdg-config |
| 56 | + URI_BRIDGE_MACOS_APP_DIR: ${{ runner.temp }}/Applications |
| 57 | + run: | |
| 58 | + export PATH="$HOME/.local/bin:$PATH" |
| 59 | + command -v slicer-uri-bridge |
| 60 | + slicer-uri-bridge --version |
| 61 | + slicer-uri-bridge status |
| 62 | + test -f "$URI_BRIDGE_MACOS_APP_DIR/SlicerURIBridge.app/Contents/Info.plist" |
| 63 | +
|
| 64 | + windows-installer: |
| 65 | + name: Windows installer |
| 66 | + runs-on: windows-latest |
| 67 | + |
| 68 | + steps: |
| 69 | + - name: Check out repository |
| 70 | + uses: actions/checkout@v4 |
| 71 | + |
| 72 | + - name: Set up Python |
| 73 | + uses: actions/setup-python@v5 |
| 74 | + with: |
| 75 | + python-version: "3.13" |
| 76 | + |
| 77 | + - name: Run installer |
| 78 | + shell: powershell |
| 79 | + env: |
| 80 | + SLICER_URI_BRIDGE_PROJECT_SPEC: ${{ github.workspace }} |
| 81 | + LOCALAPPDATA: ${{ runner.temp }}\LocalAppData |
| 82 | + APPDATA: ${{ runner.temp }}\AppData |
| 83 | + run: .\install-windows.ps1 |
| 84 | + |
| 85 | + - name: Verify installation |
| 86 | + shell: powershell |
| 87 | + env: |
| 88 | + LOCALAPPDATA: ${{ runner.temp }}\LocalAppData |
| 89 | + APPDATA: ${{ runner.temp }}\AppData |
| 90 | + run: | |
| 91 | + $bridge = Join-Path $env:LOCALAPPDATA 'slicer-uri-bridge\venv\Scripts\slicer-uri-bridge.exe' |
| 92 | + if (-not (Test-Path -LiteralPath $bridge)) { |
| 93 | + throw "Bridge command was not installed: $bridge" |
| 94 | + } |
| 95 | +
|
| 96 | + & $bridge --version |
| 97 | + & $bridge status |
| 98 | +
|
| 99 | + $command = (Get-Item -LiteralPath 'HKCU:\Software\Classes\bambustudioopen\shell\open\command').GetValue('') |
| 100 | + if ($command -notmatch 'slicer_uri_bridge\.handler') { |
| 101 | + throw "Unexpected bambustudioopen handler command: $command" |
| 102 | + } |
0 commit comments