docs: generate API reference docs from TS packages #100
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: | |
| pull_request: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| permissions: | |
| id-token: write | |
| contents: read | |
| pull-requests: read | |
| jobs: | |
| detect-changes: | |
| runs-on: | |
| group: databricks-protected-runner-group | |
| labels: linux-ubuntu-latest | |
| name: Detect Changes | |
| outputs: | |
| docs: ${{ steps.filter.outputs.docs }} | |
| appkit: ${{ steps.filter.outputs.appkit }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| docs: | |
| - 'docs/**' | |
| - 'packages/**' | |
| appkit: | |
| - '!docs/**' | |
| lint_and_typecheck: | |
| name: Lint & Type Check | |
| runs-on: | |
| group: databricks-protected-runner-group | |
| labels: linux-ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run Lint | |
| run: pnpm run lint | |
| - name: Run Format Check | |
| run: pnpm run format:check | |
| - name: Run Types Check | |
| run: pnpm run typecheck | |
| - name: Run License Check | |
| run: pnpm run check:licenses | |
| test: | |
| name: Unit Tests | |
| needs: detect-changes | |
| if: needs.detect-changes.outputs.appkit == 'true' | |
| runs-on: | |
| group: databricks-protected-runner-group | |
| labels: linux-ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run Tests | |
| run: pnpm test | |
| docs-build: | |
| name: Docs Build | |
| needs: detect-changes | |
| if: needs.detect-changes.outputs.docs == 'true' | |
| runs-on: | |
| group: databricks-protected-runner-group | |
| labels: linux-ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build Docs | |
| run: pnpm run docs:build | |
| - name: Lint Generated Docs | |
| run: pnpm run docs:lint | |
| - name: Format Generated Docs | |
| run: pnpm run docs:format | |
| - name: Check for uncommitted docs changes | |
| run: | | |
| if ! git diff --exit-code docs/docs/api/; then | |
| echo "❌ Error: Generated docs are out of sync with the codebase." | |
| echo "" | |
| echo "The API documentation in docs/docs/api/ has changes after running docs:generate." | |
| echo "This means the committed docs don't match the current package code." | |
| echo "" | |
| echo "To fix this:" | |
| echo " 1. Run: pnpm docs:build" | |
| echo " 2. Run: pnpm docs:format" | |
| echo " 3. Review and commit the changes" | |
| echo "" | |
| exit 1 | |
| fi | |