name: CI on: push: branches: - main - dev pull_request: # Run on all PRs, regardless of target branch workflow_dispatch: # Manual fire — useful when GH's event routing has gotten stuck and # push/pull_request events aren't auto-scheduling the workflow. jobs: lint-and-test: runs-on: [self-hosted, linux, x64, llmist-ci] environment: CI steps: - uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: "22" cache: "npm" - name: Install npm 10.9.2 run: | npm install --global npm@10.9.2 node --version npm --version node -e "require('node:assert/strict').equal(process.versions.node.split('.')[0], '22')" test "$(npm --version)" = "10.9.2" - name: Install dependencies run: npm ci - name: Build packages run: npm run build - name: Run typecheck run: npm run typecheck - name: Run linter run: npm run lint - name: Run unit tests run: npm run test env: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} - name: Run unit tests with coverage run: npm run test:coverage env: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} - name: Upload coverage reports # Bumped from @v4 → @v5: the cached SHA GH had resolved for @v4 # (b9fd7d16…) was orphaned when codecov force-pushed the tag, # causing every CI run to fail instantly at setup with # "An action could not be found at the URI …". v5 has the same # `with:` interface. uses: codecov/codecov-action@v5 continue-on-error: true with: token: ${{ secrets.CODECOV_TOKEN }} files: ./coverage/lcov.info fail_ci_if_error: false verbose: true validate-commits: runs-on: [self-hosted, linux, x64, llmist-ci] # Skip validation for PRs from dev to main (release PRs) since dev accumulates merge commit history if: github.event_name == 'pull_request' && !(github.head_ref == 'dev' && github.base_ref == 'main') steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: "22" cache: "npm" - name: Install npm 10.9.2 run: | npm install --global npm@10.9.2 node --version npm --version node -e "require('node:assert/strict').equal(process.versions.node.split('.')[0], '22')" test "$(npm --version)" = "10.9.2" - name: Install dependencies run: npm ci - name: Validate PR commits run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose e2e-tests: # E2E tests now use mocks, so they can run on all PRs without API costs runs-on: [self-hosted, linux, x64, llmist-ci] environment: CI steps: - uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: "22" cache: "npm" - name: Install npm 10.9.2 run: | npm install --global npm@10.9.2 node --version npm --version node -e "require('node:assert/strict').equal(process.versions.node.split('.')[0], '22')" test "$(npm --version)" = "10.9.2" - name: Install dependencies run: npm ci - name: Build packages run: npm run build - name: Run E2E tests run: npm run test:e2e env: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}