---
name: Installer Smoke
on:
  push:
    branches: [main]
  pull_request:
  workflow_dispatch:
permissions:
  contents: read
jobs:
  smoke-unix:
    name: Smoke install.sh (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        # ubuntu-22.04 re-enabled: install.sh --dry-run now warns + exits 0 when
        # no Linux release asset is published (see #785).
        os: [macos-latest, ubuntu-22.04]
    steps:
      - name: Checkout
        uses: actions/checkout@v5
      - name: Unit tests (install.sh helpers)
        run: bash scripts/test_install.sh
      - name: Run installer dry-run
        run: bash scripts/install.sh --dry-run --verbose

  smoke-windows:
    name: install.ps1 tests + dry-run (windows-latest)
    runs-on: windows-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v5

      - name: Unit tests (MSI args / asset selection)
        shell: pwsh
        run: pwsh -NoProfile -File ./scripts/tests/OpenHumanWindowsInstall.Tests.ps1

      - name: Run installer dry-run
        shell: pwsh
        run: ./scripts/install.ps1 -DryRun
