name: opencode-plugin CI on: push: branches: [main, "release/**"] paths: - "@omniroute/opencode-plugin/**" - "@omniroute/opencode-plugin-v2/**" pull_request: branches: [main, "release/**"] paths: - "@omniroute/opencode-plugin/**" - "@omniroute/opencode-plugin-v2/**" types: [opened, synchronize, reopened, ready_for_review] workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true permissions: contents: read defaults: run: working-directory: "@omniroute/opencode-plugin" jobs: test: name: Test (Node ${{ matrix.node }}) runs-on: ubuntu-latest strategy: fail-fast: false matrix: node: ["22", "24"] steps: - uses: actions/checkout@v7 with: persist-credentials: false - uses: actions/setup-node@v7 with: node-version: ${{ matrix.node }} cache: npm cache-dependency-path: "@omniroute/opencode-plugin/package-lock.json" - run: npm install --no-audit --no-fund - run: npm run build - run: npm test test-v2: name: Test v2 (Node ${{ matrix.node }}) runs-on: ubuntu-latest strategy: fail-fast: false matrix: node: ["22", "24"] defaults: run: working-directory: "@omniroute/opencode-plugin-v2" steps: - uses: actions/checkout@v7 with: persist-credentials: false - uses: actions/setup-node@v7 with: node-version: ${{ matrix.node }} cache: npm cache-dependency-path: "@omniroute/opencode-plugin-v2/package-lock.json" - run: npm ci --no-audit --no-fund - run: npm run build - run: npm test build: name: Build runs-on: ubuntu-latest needs: [test, test-v2] steps: - uses: actions/checkout@v7 with: persist-credentials: false - uses: actions/setup-node@v7 with: node-version: "22" - name: Build plugin-v2 artifact working-directory: "@omniroute/opencode-plugin-v2" run: npm ci --no-audit --no-fund && npm run build - uses: actions/upload-artifact@v7 with: name: opencode-plugin-v2-dist path: "@omniroute/opencode-plugin-v2/dist" retention-days: 7