Combined #1819
Workflow file for this run
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: Build & Test | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.head.ref || github.ref_name }} | |
| cancel-in-progress: true | |
| env: | |
| CI: "true" | |
| DO_NOT_TRACK: "1" | |
| TURBO_TELEMETRY_DISABLED: "1" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - run: bun i | |
| - run: bun run build | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: build-output | |
| path: packages/*/dist/** | |
| retention-days: 1 | |
| test-bun-unit: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - run: bun i | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: build-output | |
| path: packages | |
| - name: Run unit tests via bun | |
| run: bun run test:bun:unit | |
| test-bun-integration: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - run: bun i | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: build-output | |
| path: packages | |
| - name: Run integration tests via bun | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | |
| run: bun run test:bun:integration | |
| test-bun-rag: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - run: bun i | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: build-output | |
| path: packages | |
| - name: Run rag tests via bun | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | |
| run: bun run test:bun:rag | |
| test-bun-ai-provider-hft: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - run: bun i | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: build-output | |
| path: packages | |
| - name: Run HuggingFace Transformers provider tests via bun | |
| run: bun run test:bun:ai-provider-hft | |
| test-bun-ai-provider-llamacpp: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - run: bun i | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: build-output | |
| path: packages | |
| - name: Run LlamaCpp provider tests via bun | |
| run: bun run test:bun:ai-provider-llamacpp | |
| test-bun-ai-provider-api: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - run: bun i | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: build-output | |
| path: packages | |
| - name: Run API provider tests via bun | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | |
| run: bun run test:bun:ai-provider-api | |
| test-vitest-unit: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - run: bun i | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: build-output | |
| path: packages | |
| - name: Run unit tests via vitest | |
| run: bun run test:vitest:unit | |
| - name: Copy Vitest coverage fragment | |
| run: cp coverage/coverage-final.json vitest-unit-coverage.json | |
| - name: Upload Vitest coverage fragment | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: coverage-vitest-unit | |
| path: vitest-unit-coverage.json | |
| retention-days: 1 | |
| test-vitest-integration: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - run: bun i | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: build-output | |
| path: packages | |
| - name: Run integration tests via vitest | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | |
| run: bun run test:vitest:integration | |
| - name: Copy Vitest coverage fragment | |
| run: cp coverage/coverage-final.json vitest-integration-coverage.json | |
| - name: Upload Vitest coverage fragment | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: coverage-vitest-integration | |
| path: vitest-integration-coverage.json | |
| retention-days: 1 | |
| test-vitest-rag: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - run: bun i | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: build-output | |
| path: packages | |
| - name: Run rag tests via vitest | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | |
| run: bun run test:vitest:rag | |
| - name: Copy Vitest coverage fragment | |
| run: cp coverage/coverage-final.json vitest-rag-coverage.json | |
| - name: Upload Vitest coverage fragment | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: coverage-vitest-rag | |
| path: vitest-rag-coverage.json | |
| retention-days: 1 | |
| test-vitest-ai-provider-hft: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - run: bun i | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: build-output | |
| path: packages | |
| - name: Run HuggingFace Transformers provider tests via vitest | |
| run: bun run test:vitest:ai-provider-hft | |
| - name: Copy Vitest coverage fragment | |
| run: cp coverage/coverage-final.json vitest-ai-provider-hft-coverage.json | |
| - name: Upload Vitest coverage fragment | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: coverage-vitest-ai-provider-hft | |
| path: vitest-ai-provider-hft-coverage.json | |
| retention-days: 1 | |
| test-vitest-ai-provider-llamacpp: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - run: bun i | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: build-output | |
| path: packages | |
| - name: Run LlamaCpp provider tests via vitest | |
| run: bun run test:vitest:ai-provider-llamacpp | |
| - name: Copy Vitest coverage fragment | |
| run: cp coverage/coverage-final.json vitest-ai-provider-llamacpp-coverage.json | |
| - name: Upload Vitest coverage fragment | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: coverage-vitest-ai-provider-llamacpp | |
| path: vitest-ai-provider-llamacpp-coverage.json | |
| retention-days: 1 | |
| test-vitest-ai-provider-api: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - run: bun i | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: build-output | |
| path: packages | |
| - name: Run API provider tests via vitest | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | |
| run: bun run test:vitest:ai-provider-api | |
| - name: Copy Vitest coverage fragment | |
| run: cp coverage/coverage-final.json vitest-ai-provider-api-coverage.json | |
| - name: Upload Vitest coverage fragment | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: coverage-vitest-ai-provider-api | |
| path: vitest-ai-provider-api-coverage.json | |
| retention-days: 1 | |
| merge-vitest-coverage: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - test-vitest-unit | |
| - test-vitest-integration | |
| - test-vitest-rag | |
| - test-vitest-ai-provider-hft | |
| - test-vitest-ai-provider-llamacpp | |
| - test-vitest-ai-provider-api | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - run: bun i | |
| - name: Download Vitest coverage fragments | |
| run: mkdir -p coverage-parts | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: coverage-vitest-unit | |
| path: coverage-parts | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: coverage-vitest-integration | |
| path: coverage-parts | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: coverage-vitest-rag | |
| path: coverage-parts | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: coverage-vitest-ai-provider-hft | |
| path: coverage-parts | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: coverage-vitest-ai-provider-llamacpp | |
| path: coverage-parts | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: coverage-vitest-ai-provider-api | |
| path: coverage-parts | |
| - name: Merge coverage (nyc) and emit HTML/LCOV | |
| run: | | |
| bunx nyc merge coverage-parts merged.json | |
| mkdir -p .nyc_output | |
| cp merged.json .nyc_output/out.json | |
| bunx nyc report --reporter=json --reporter=json-summary --reporter=html --reporter=lcov --reporter=text-summary --report-dir=coverage --temp-dir=.nyc_output | |
| - name: Upload merged Vitest coverage | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: vitest-coverage-merged | |
| path: coverage | |
| retention-days: 1 | |
| - name: Report Coverage | |
| if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository | |
| uses: davelosert/vitest-coverage-report-action@v2 | |
| - name: Delete Vitest coverage fragments | |
| if: always() | |
| uses: geekyeggo/delete-artifact@v6 | |
| with: | |
| name: coverage-vitest-* | |
| cleanup: | |
| runs-on: ubuntu-latest | |
| needs: [test-bun-unit, test-vitest-unit, test-bun-integration, test-vitest-integration, test-bun-rag, test-vitest-rag, test-bun-ai-provider-hft, test-bun-ai-provider-llamacpp, test-bun-ai-provider-api, test-vitest-ai-provider-hft, test-vitest-ai-provider-llamacpp, test-vitest-ai-provider-api] | |
| steps: | |
| - uses: geekyeggo/delete-artifact@v6 | |
| with: | |
| name: build-output | |