fix(sdk): restore @delegolabs/sdk dependency, types mapping, and imports #710
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: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| packages: read | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| NODE_VERSION: 20 | |
| NODE_ENV: test | |
| NEXT_PUBLIC_API_URL: "https://api.example.com" | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| registry-url: "https://npm.pkg.github.com" | |
| cache: pnpm | |
| cache-dependency-path: pnpm-lock.yaml | |
| - run: corepack enable | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN || secrets.GITHUB_TOKEN }} | |
| # Task-output caching (#635): keyed on the runner OS plus a hash of | |
| # every file turbo's task graph reads (see turbo.json "inputs") and | |
| # the lockfile, so a change anywhere relevant invalidates it — restore | |
| # keys fall back to the closest prior cache for a partial hit. | |
| - name: Restore turbo cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .turbo | |
| key: turbo-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', '**/src/**', '**/app/**', '**/components/**', '**/hooks/**', '**/lib/**', '**/*.ts', '**/*.tsx') }} | |
| restore-keys: | | |
| turbo-${{ runner.os }}- | |
| - name: Run linter | |
| run: pnpm lint | |
| - name: Check i18n message key parity | |
| run: pnpm --filter @delegolabs/web check:i18n | |
| - name: Check microcopy consistency | |
| run: pnpm --filter @delegolabs/web check:microcopy | |
| type-check: | |
| name: Type Check | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| registry-url: "https://npm.pkg.github.com" | |
| cache: pnpm | |
| cache-dependency-path: pnpm-lock.yaml | |
| - run: corepack enable | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN || secrets.GITHUB_TOKEN }} | |
| - name: Restore turbo cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .turbo | |
| key: turbo-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', '**/src/**', '**/app/**', '**/components/**', '**/hooks/**', '**/lib/**', '**/*.ts', '**/*.tsx') }} | |
| restore-keys: | | |
| turbo-${{ runner.os }}- | |
| - name: Run type check | |
| run: pnpm typecheck | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| needs: [lint, type-check] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| registry-url: "https://npm.pkg.github.com" | |
| cache: pnpm | |
| cache-dependency-path: pnpm-lock.yaml | |
| - run: corepack enable | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN || secrets.GITHUB_TOKEN }} | |
| - name: Restore turbo cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .turbo | |
| key: turbo-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', '**/src/**', '**/app/**', '**/components/**', '**/hooks/**', '**/lib/**', '**/*.ts', '**/*.tsx') }} | |
| restore-keys: | | |
| turbo-${{ runner.os }}- | |
| - name: Build shared packages | |
| run: pnpm --filter "./packages/*" --filter "./apps/frontend" build | |
| - name: Ban coverage-ignore directives in packages/ui | |
| run: pnpm --filter @delegolabs/ui check:no-coverage-ignores | |
| - name: Run packages/ui tests with coverage | |
| run: pnpm --filter @delegolabs/ui test:coverage | |
| - name: Run remaining package tests | |
| run: pnpm --filter "./packages/*" --filter '!@delegolabs/ui' test | |
| - name: Run frontend tests with coverage | |
| run: pnpm --filter @delegolabs/web test:coverage | |
| - name: Upload coverage report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: apps/frontend/coverage | |
| retention-days: 7 | |
| - name: Upload packages/ui coverage report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ui-coverage-report | |
| path: packages/ui/coverage | |
| retention-days: 7 | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| needs: [test] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| registry-url: "https://npm.pkg.github.com" | |
| cache: pnpm | |
| cache-dependency-path: pnpm-lock.yaml | |
| - run: corepack enable | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN || secrets.GITHUB_TOKEN }} | |
| - name: Restore turbo cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .turbo | |
| key: turbo-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', '**/src/**', '**/app/**', '**/components/**', '**/hooks/**', '**/lib/**', '**/*.ts', '**/*.tsx') }} | |
| restore-keys: | | |
| turbo-${{ runner.os }}- | |
| - name: Build project | |
| run: pnpm build | |
| env: | |
| # Uploads source maps and tags the release with the commit SHA when | |
| # a Sentry project is configured (#511); silently skipped otherwise. | |
| NEXT_PUBLIC_SENTRY_DSN: ${{ secrets.SENTRY_DSN }} | |
| NEXT_PUBLIC_SENTRY_RELEASE: ${{ github.sha }} | |
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
| SENTRY_ORG: ${{ secrets.SENTRY_ORG }} | |
| SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} | |
| a11y: | |
| name: Accessibility Scan | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| needs: [build] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| registry-url: "https://npm.pkg.github.com" | |
| cache: pnpm | |
| cache-dependency-path: pnpm-lock.yaml | |
| - run: corepack enable | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN || secrets.GITHUB_TOKEN }} | |
| - name: Build shared packages and frontend | |
| run: pnpm --filter "./packages/*" --filter "./apps/frontend" build | |
| - name: Install Playwright browsers | |
| working-directory: apps/frontend | |
| run: pnpm exec playwright install --with-deps chromium | |
| - name: Run axe accessibility gate and golden-path E2E | |
| working-directory: apps/frontend | |
| run: pnpm test:e2e --project=chromium | |
| - name: Upload Playwright report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-report | |
| path: apps/frontend/playwright-report | |
| retention-days: 7 | |
| visual-regression: | |
| name: Visual Regression | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| needs: [build] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| registry-url: "https://npm.pkg.github.com" | |
| cache: pnpm | |
| cache-dependency-path: pnpm-lock.yaml | |
| - run: corepack enable | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN || secrets.GITHUB_TOKEN }} | |
| - name: Build shared packages and frontend | |
| run: pnpm --filter "./packages/*" --filter "./apps/frontend" build | |
| - name: Install Playwright browsers | |
| working-directory: apps/frontend | |
| run: pnpm exec playwright install --with-deps chromium | |
| - name: Run visual regression suite | |
| working-directory: apps/frontend | |
| run: pnpm test:e2e:visual | |
| - name: Upload diff artifacts on failure | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: visual-regression-diffs | |
| path: apps/frontend/test-results | |
| retention-days: 7 | |
| security-scan: | |
| name: Security Scan | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| registry-url: "https://npm.pkg.github.com" | |
| cache: pnpm | |
| cache-dependency-path: pnpm-lock.yaml | |
| - run: corepack enable | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN || secrets.GITHUB_TOKEN }} | |
| - name: Run audit | |
| run: pnpm audit --prod --audit-level=high | |
| continue-on-error: true | |
| bundle-size: | |
| name: Bundle Size Gate | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| # Depends on the build job so we don't waste a runner if the build is broken. | |
| needs: [build] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| registry-url: "https://npm.pkg.github.com" | |
| cache: pnpm | |
| cache-dependency-path: pnpm-lock.yaml | |
| - run: corepack enable | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN || secrets.GITHUB_TOKEN }} | |
| # Restore a previously recorded baseline from the cache so the delta | |
| # column in the report is meaningful. On first run it will be empty. | |
| - name: Restore bundle size baseline | |
| uses: actions/cache@v4 | |
| with: | |
| path: apps/frontend/.bundle-size-baseline.json | |
| key: bundle-size-baseline-${{ github.ref_name }} | |
| restore-keys: | | |
| bundle-size-baseline-main | |
| bundle-size-baseline- | |
| - name: Run bundle-size gate | |
| id: bundle_size | |
| working-directory: apps/frontend | |
| run: pnpm check:perf-budget | |
| env: | |
| NEXT_PUBLIC_API_URL: "https://api.example.com" | |
| NEXT_TELEMETRY_DISABLED: "1" | |
| # Always save the updated baseline so future runs have a delta. | |
| - name: Save bundle size baseline | |
| if: always() | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: apps/frontend/.bundle-size-baseline.json | |
| key: bundle-size-baseline-${{ github.ref_name }} | |
| # Upload the baseline JSON as an artifact for the PR delta-comment job. | |
| - name: Upload bundle size report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: bundle-size-report | |
| path: apps/frontend/.bundle-size-baseline.json | |
| retention-days: 30 | |
| api-drift: | |
| name: API Client Drift Check | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| registry-url: "https://npm.pkg.github.com" | |
| cache: pnpm | |
| cache-dependency-path: pnpm-lock.yaml | |
| - run: corepack enable | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN || secrets.GITHUB_TOKEN }} | |
| - name: Check API client is not stale | |
| working-directory: packages/api-generated | |
| run: node scripts/check-drift.mjs |