Make installer backup checks portable and run platform builds in para… #190
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: CI | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| - alpha | |
| - beta | |
| push: | |
| branches-ignore: | |
| - main | |
| - alpha | |
| - beta | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: 24 | |
| package-manager-cache: false | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version-file: package.json | |
| - name: Install build tools (Ubuntu) | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt-get install -y build-essential python3 make g++ | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Type check | |
| run: bun run typecheck | |
| - name: Run tests | |
| run: bun run test:ci | |
| tuistory: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| # The built terminal tests assert the CLI renders the latest stable | |
| # release tag, which they find with `git tag --merged HEAD`. | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: 24 | |
| package-manager-cache: false | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version-file: package.json | |
| - name: Install build tools (Ubuntu) | |
| run: sudo apt-get update && sudo apt-get install -y build-essential python3 make g++ | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Build CLI for terminal tests | |
| run: bun run build | |
| - name: Run built terminal tests | |
| run: bun run test:tuistory | |
| build-test: | |
| # These jobs build independently, so report platform failures alongside the suites. | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [macos-latest, ubuntu-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: 24 | |
| package-manager-cache: false | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version-file: package.json | |
| - name: Install build tools (Ubuntu) | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt-get install -y build-essential python3 make g++ | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Test Windows installer architecture detection | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: bun run test -- tests/windowsInstaller.spec.ts | |
| - name: Build | |
| run: bun run build | |
| - name: Test compilation | |
| run: | | |
| mkdir -p binaries | |
| # See release.yml's Compile binary step: node-llama-cpp's dynamic | |
| # platform-binary resolution can't be statically bundled. | |
| bun build ./src/index.ts --compile --external node-llama-cpp --outfile ./binaries/autohand-test | |
| - name: Verify binary (Unix) | |
| if: runner.os != 'Windows' | |
| run: | | |
| chmod +x ./binaries/autohand-test | |
| ./binaries/autohand-test --help | |
| - name: Smoke test Windows binary | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| timeout-minutes: 1 | |
| run: | | |
| $binary = (Resolve-Path "./binaries/autohand-test.exe").Path | |
| & $binary --version | |
| if ($LASTEXITCODE -ne 0) { | |
| throw "Windows --version smoke test failed with exit code $LASTEXITCODE" | |
| } | |
| & $binary --help | Out-Null | |
| if ($LASTEXITCODE -ne 0) { | |
| throw "Windows --help smoke test failed with exit code $LASTEXITCODE" | |
| } |