ci: add CI with OpenCode e2e, weekly latest-OpenCode e2e, release workflow, and Dependabot
- ci.yml: unit tests on Node 22, 24, 26 plus the end-to-end check against OpenCode 1.18.31 + 2.0.32 and 1.19.3 + 2.1.0 - e2e-latest.yml: weekly end-to-end run against the newest opencode-ai and @opencode/cli releases - release.yml: tag vX.Y.Z reruns CI and publishes with npm trusted publishing - Jobs run on GitHub only; the Gitea origin's runner skips them - Dependabot proposes grouped npm and Actions updates weekly
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
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
|
||||
Reference in New Issue
Block a user