chore: release (#51) #387
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: | |
| push: | |
| branches: [main] | |
| # Cancel in-progress runs on same branch | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| # Shared cache key components | |
| CACHE_PREFIX: v1 | |
| jobs: | |
| # Determine what changed to skip unnecessary jobs | |
| changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| code: ${{ steps.filter.outputs.code }} | |
| docs: ${{ steps.filter.outputs.docs }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| code: | |
| - 'src/**' | |
| - 'editor/**' | |
| - 'integrations/**' | |
| - 'toolbar/**' | |
| - 'package.json' | |
| - 'pnpm-lock.yaml' | |
| - 'tsconfig*.json' | |
| - 'vitest*.config.ts' | |
| - 'playwright.config.ts' | |
| - '.github/workflows/**' | |
| docs: | |
| - 'docs/**' | |
| # Install dependencies once, cache for all jobs | |
| install: | |
| needs: changes | |
| if: needs.changes.outputs.code == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: pnpm | |
| - name: Cache node_modules | |
| uses: actions/cache@v4 | |
| id: cache-modules | |
| with: | |
| path: | | |
| node_modules | |
| editor/node_modules | |
| integrations/*/node_modules | |
| docs/node_modules | |
| key: ${{ env.CACHE_PREFIX }}-modules-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Install dependencies | |
| if: steps.cache-modules.outputs.cache-hit != 'true' | |
| run: pnpm install --frozen-lockfile | |
| # Fast lint & format checks - run in parallel | |
| lint: | |
| needs: install | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: pnpm | |
| - name: Restore node_modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| editor/node_modules | |
| integrations/*/node_modules | |
| docs/node_modules | |
| key: ${{ env.CACHE_PREFIX }}-modules-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Format check | |
| run: pnpm format:check | |
| - name: Lint | |
| run: pnpm lint | |
| - name: Lint editor | |
| run: pnpm lint:editor | |
| - name: Lint integrations | |
| run: pnpm lint:integrations | |
| # Type checking - run in parallel with lint | |
| typecheck: | |
| needs: install | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: pnpm | |
| - name: Restore node_modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| editor/node_modules | |
| integrations/*/node_modules | |
| docs/node_modules | |
| key: ${{ env.CACHE_PREFIX }}-modules-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Typecheck | |
| run: pnpm typecheck | |
| - name: Typecheck editor | |
| run: pnpm typecheck:editor | |
| - name: Typecheck integrations | |
| run: pnpm typecheck:integrations | |
| - name: Svelte warnings check | |
| run: pnpm check:svelte | |
| # Code quality checks - run in parallel | |
| quality: | |
| needs: install | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: pnpm | |
| - name: Restore node_modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| editor/node_modules | |
| integrations/*/node_modules | |
| docs/node_modules | |
| key: ${{ env.CACHE_PREFIX }}-modules-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Knip (unused code) | |
| run: pnpm knip | |
| - name: Changeset status | |
| if: github.event_name == 'pull_request' && github.head_ref != 'changeset-release/main' | |
| run: pnpm changeset status --since=origin/main | |
| # Unit tests - run in parallel | |
| unit-tests: | |
| needs: install | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: pnpm | |
| - name: Restore node_modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| editor/node_modules | |
| integrations/*/node_modules | |
| docs/node_modules | |
| key: ${{ env.CACHE_PREFIX }}-modules-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Unit tests with coverage | |
| run: pnpm vitest run --coverage | |
| - name: Editor unit tests with coverage | |
| run: pnpm test:editor:coverage | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: ./coverage/lcov.info,./coverage/editor/lcov.info | |
| fail_ci_if_error: false | |
| # Editor E2E tests - runs on self-hosted Din runners for speed | |
| editor-e2e: | |
| needs: changes | |
| if: needs.changes.outputs.code == 'true' | |
| runs-on: [self-hosted, din] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| clean: false | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install dependencies | |
| run: pnpm install --prefer-offline | |
| - name: Build editor | |
| run: pnpm build:editor | |
| - name: Install Playwright browsers | |
| run: pnpm exec playwright install chromium | |
| - name: Run e2e tests | |
| run: pnpm test:editor:e2e | |
| - name: Upload test artifacts | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-report | |
| path: editor/test-results/ | |
| retention-days: 7 | |
| # Verify API reference docs are up-to-date with Zod schemas | |
| generate-docs: | |
| needs: changes | |
| if: github.event_name == 'pull_request' && needs.changes.outputs.code == 'true' | |
| runs-on: 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: Generate API reference docs | |
| run: | | |
| pnpm docs:generate | |
| pnpm prettier --write docs/docs/*-reference.md | |
| - name: Verify docs are up-to-date | |
| run: | | |
| if [ -n "$(git status --porcelain docs/docs/*-reference.md)" ]; then | |
| echo "::error::API reference docs are out of date. Run 'pnpm docs:generate' and commit the changes." | |
| git diff docs/docs/*-reference.md | |
| exit 1 | |
| else | |
| echo "Docs are up-to-date" | |
| fi | |
| # CLI integration tests - runs on self-hosted Din runners for speed | |
| cli-tests: | |
| needs: changes | |
| if: needs.changes.outputs.code == 'true' | |
| runs-on: [self-hosted, din] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| clean: false | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install dependencies | |
| run: pnpm install --prefer-offline | |
| - name: Build CLI | |
| run: pnpm build | |
| - name: Install Playwright browsers | |
| run: pnpm exec playwright install chromium | |
| - name: Run CLI integration tests | |
| run: pnpm test:cli |