feat(opencode): canonical 模型ID 规范化校验(自有账号白名单/渠道定价/映射) + 前端密钥弹窗/CC切换导入… #113
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: | |
| push: | |
| pull_request: | |
| workflow_call: | |
| inputs: | |
| frontend_coverage: | |
| description: 'Run the coverage-enforced frontend suite' | |
| required: false | |
| type: boolean | |
| default: false | |
| upload_frontend_artifact: | |
| description: 'Build and upload the frontend artifact for release' | |
| required: false | |
| type: boolean | |
| default: false | |
| checkout_ref: | |
| description: 'Git ref to validate; defaults to the triggering ref' | |
| required: false | |
| type: string | |
| default: '' | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ inputs.checkout_ref || github.ref }} | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: backend/go.mod | |
| check-latest: false | |
| cache: true | |
| cache-dependency-path: backend/go.sum | |
| - name: Verify Go version | |
| run: | | |
| go version | grep -q 'go1.26.6' | |
| - name: Unit tests | |
| working-directory: backend | |
| run: make test-unit | |
| - name: Integration tests | |
| working-directory: backend | |
| run: make test-integration | |
| - name: Provider-free contract E2E | |
| working-directory: backend | |
| run: make test-e2e-contract | |
| frontend: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ inputs.checkout_ref || github.ref }} | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| cache-dependency-path: frontend/pnpm-lock.yaml | |
| - name: Install frontend dependencies | |
| working-directory: frontend | |
| run: pnpm install --frozen-lockfile | |
| - name: Frontend lint, typecheck, and full vitest | |
| if: ${{ !inputs.frontend_coverage }} | |
| run: make test-frontend | |
| - name: Frontend lint, typecheck, and coverage gate | |
| if: ${{ inputs.frontend_coverage }} | |
| run: make test-frontend-coverage | |
| - name: Build frontend release artifact | |
| if: ${{ inputs.upload_frontend_artifact }} | |
| working-directory: frontend | |
| run: pnpm run build | |
| - name: Upload frontend release artifact | |
| if: ${{ inputs.upload_frontend_artifact }} | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: frontend-dist | |
| path: backend/internal/web/dist/ | |
| retention-days: 1 | |
| docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ inputs.checkout_ref || github.ref }} | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| cache-dependency-path: docs/site/pnpm-lock.yaml | |
| - name: Install documentation dependencies | |
| working-directory: docs/site | |
| run: pnpm install --frozen-lockfile | |
| - name: Lint, validate links, and build documentation | |
| working-directory: docs/site | |
| run: pnpm run check | |
| golangci-lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ inputs.checkout_ref || github.ref }} | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: backend/go.mod | |
| check-latest: false | |
| cache: true | |
| cache-dependency-path: backend/go.sum | |
| - name: Verify Go version | |
| run: | | |
| go version | grep -q 'go1.26.6' | |
| - name: golangci-lint | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: v2.9 | |
| args: --timeout=30m | |
| working-directory: backend |