name: CI on: push: branches: [main] pull_request: workflow_call: permissions: contents: read concurrency: group: ci-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: test: name: Test (Node ${{ matrix.node }}) # GitHub only: the Gitea origin also runs .github/workflows. if: github.server_url == 'https://github.com' runs-on: ubuntu-latest strategy: fail-fast: false matrix: node: [22, 24, 26] env: HUSKY: "0" steps: - uses: actions/checkout@v7 - uses: actions/setup-node@v7 with: node-version: ${{ matrix.node }} cache: npm - run: npm ci - run: npm run typecheck - run: npm test - name: Check package contents run: npm pack --dry-run e2e: name: E2E (OpenCode ${{ matrix.opencode1 }} + ${{ matrix.opencode2 }}) # GitHub only: the Gitea origin also runs .github/workflows. if: github.server_url == 'https://github.com' runs-on: ubuntu-latest strategy: fail-fast: false matrix: include: - opencode1: 1.18.31 opencode2: 2.0.32 - opencode1: 1.19.3 opencode2: 2.1.0 env: HUSKY: "0" E2E_REQUIRE_ALL: "1" steps: - uses: actions/checkout@v7 - uses: actions/setup-node@v7 with: node-version: 24 cache: npm - run: npm ci - name: Install OpenCode 1 and OpenCode 2 side by side run: | npm install -g --prefix "$RUNNER_TEMP/opencode1" "opencode-ai@${{ matrix.opencode1 }}" npm install -g --prefix "$RUNNER_TEMP/opencode2" "@opencode/cli@${{ matrix.opencode2 }}" echo "OPENCODE_V1_BIN=$RUNNER_TEMP/opencode1/bin/opencode" >> "$GITHUB_ENV" echo "OPENCODE_V2_BIN=$RUNNER_TEMP/opencode2/bin/opencode2" >> "$GITHUB_ENV" - run: npm run test:e2e