113 lines
3.6 KiB
YAML
113 lines
3.6 KiB
YAML
name: sdk-test
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "sdk/**"
|
|
- ".github/workflows/sdk-test.yml"
|
|
workflow_dispatch:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "sdk/**"
|
|
- ".github/workflows/sdk-test.yml"
|
|
workflow_call:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
defaults:
|
|
run:
|
|
working-directory: .
|
|
|
|
jobs:
|
|
quality-checks:
|
|
runs-on: ubuntu-latest
|
|
name: Quality Checks
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Bun
|
|
uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: "1.3.13"
|
|
|
|
- name: Install dependencies
|
|
run: bun install
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Typecheck
|
|
run: |
|
|
bun run build:sdk
|
|
bun run -F @cline/cli build
|
|
bun run types
|
|
|
|
- name: Lint & Format
|
|
run: bun run lint
|
|
|
|
test:
|
|
needs: quality-checks
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-latest
|
|
node-version: "24.x"
|
|
- os: windows-latest
|
|
node-version: "24.x"
|
|
runs-on: ${{ matrix.os }}
|
|
name: Test (${{ matrix.os }}, Node ${{ matrix.node-version }})
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Bun
|
|
uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: "1.3.13"
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
- name: Install dependencies
|
|
run: bun install
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build SDK
|
|
id: build_sdk_step
|
|
run: bun run build:sdk
|
|
|
|
- name: Build CLI
|
|
id: build_cli_step
|
|
if: ${{ !cancelled() && steps.build_sdk_step.outcome == 'success' }}
|
|
run: bun -F @cline/cli build
|
|
|
|
- name: Run Tests
|
|
if: ${{ !cancelled() && steps.build_sdk_step.outcome == 'success' && steps.build_cli_step.outcome == 'success' && matrix.os != 'windows-latest' }}
|
|
run: bun run test
|
|
|
|
- name: Run SDK Tests (Windows)
|
|
if: ${{ !cancelled() && steps.build_sdk_step.outcome == 'success' && steps.build_cli_step.outcome == 'success' && matrix.os == 'windows-latest' }}
|
|
run: bun -F './sdk/packages/**' test
|
|
|
|
- name: Smoke test SQLite under Node
|
|
if: ${{ !cancelled() && steps.build_sdk_step.outcome == 'success' && matrix.os != 'windows-latest' }}
|
|
timeout-minutes: 10
|
|
run: bun sdk/scripts/ci-node-smoke.ts
|
|
|
|
- name: Run TUI e2e tests
|
|
if: ${{ !cancelled() && steps.build_sdk_step.outcome == 'success' && steps.build_cli_step.outcome == 'success' && matrix.os == 'ubuntu-latest' && matrix.node-version == '24.x' }}
|
|
run: bun -F @cline/cli test:e2e:cli:tui
|
|
|
|
- name: Verify packages are publishable
|
|
if: ${{ !cancelled() && steps.build_sdk_step.outcome == 'success' && steps.build_cli_step.outcome == 'success' && matrix.os == 'ubuntu-latest' && matrix.node-version == '24.x' }}
|
|
run: bun sdk/scripts/check-publish.ts
|