Merge pull request #50 from absolutepraya/absolutepraya/login-redesign #409
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: ["*"] | |
| push: | |
| branches: ["main"] | |
| # Skip CI (and therefore the image build + staging redeploy) for changes that | |
| # don't affect the app, so docs/script-only commits don't churn the pipeline. | |
| paths-ignore: | |
| - "**/*.md" | |
| - "docs/**" | |
| - "deploy/**" | |
| - "start-dev.sh" | |
| - "stop-dev.sh" | |
| - "LICENSE" | |
| - ".gitignore" | |
| merge_group: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| # You can leverage Vercel Remote Caching with Turbo to speed up your builds | |
| env: | |
| FORCE_COLOR: 3 | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| persist-credentials: false | |
| - name: Setup | |
| uses: ./tooling/github/setup | |
| - name: Lint | |
| run: pnpm lint && pnpm exec sherif --ignore-dependency tailwindcss --ignore-dependency @tailwindcss/typography | |
| format: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| persist-credentials: false | |
| - name: Setup | |
| uses: ./tooling/github/setup | |
| - name: Format | |
| run: pnpm format | |
| typecheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Fork divergence: with no Turbo remote cache, CI typechecks all 28 packages | |
| # from scratch (every task is a cache miss), which exhausts the hosted runner's | |
| # ~14GB disk. Reclaim ~20GB of preinstalled toolchains we don't use first. | |
| - name: Free up disk space | |
| run: | | |
| set -euo pipefail | |
| echo "Disk before cleanup:"; df -h / | |
| sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/.ghcup /usr/local/lib/android /opt/hostedtoolcache/CodeQL || true | |
| sudo docker image prune --all --force || true | |
| echo "Disk after cleanup:"; df -h / | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| persist-credentials: false | |
| - name: Setup | |
| uses: ./tooling/github/setup | |
| - name: Typecheck | |
| run: pnpm typecheck | |
| tests: | |
| runs-on: ubuntu-latest | |
| # E2E builds the complete AIO image. Cap the job so a runner or Docker | |
| # BuildKit stall fails with usable logs instead of consuming six hours. | |
| timeout-minutes: 30 | |
| steps: | |
| # Fork divergence: the E2E job builds the full AIO Docker image (Rust monolith + | |
| # full monorepo + native modules) plus several sidecar containers, which exhausts | |
| # the ~14GB free disk on the default hosted runner. Reclaim ~20GB of preinstalled | |
| # toolchains we don't use before that build runs. | |
| - name: Free up disk space | |
| run: | | |
| set -euo pipefail | |
| echo "Disk before cleanup:"; df -h / | |
| sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/.ghcup /usr/local/lib/android /opt/hostedtoolcache/CodeQL || true | |
| sudo docker image prune --all --force || true | |
| echo "Disk after cleanup:"; df -h / | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| persist-credentials: false | |
| - name: Setup | |
| uses: ./tooling/github/setup | |
| with: | |
| # Vitest + better-sqlite3 can abort during worker teardown on Node 24. | |
| # Node 22.21.1 passed the TRPC and workers suites in CI run #124. | |
| # Remove this override once nodejs/node#65042 ships in Node 24. | |
| node-version: "22.21.1" | |
| - name: Shared Package Tests | |
| working-directory: packages/shared | |
| run: pnpm test | |
| - name: TRPC Tests | |
| working-directory: packages/trpc | |
| run: pnpm test | |
| - name: Workers Tests | |
| working-directory: apps/workers | |
| run: pnpm test | |
| - name: E2E Tests | |
| working-directory: packages/e2e_tests | |
| env: | |
| # Keep the last active Docker build step visible if E2E startup fails. | |
| BUILDKIT_PROGRESS: plain | |
| run: pnpm test | |
| - name: Upload Docker Logs | |
| if: failure() | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: e2e-docker-logs-${{ github.sha }}-${{ github.run_attempt }} | |
| path: packages/e2e_tests/setup/docker-logs/ | |
| retention-days: 7 | |
| open-api-spec: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| persist-credentials: false | |
| - name: Setup | |
| uses: ./tooling/github/setup | |
| - name: Regenerate OpenAPI spec | |
| working-directory: packages/open-api | |
| run: pnpm run generate | |
| - name: Check for changes | |
| run: | | |
| if [[ -n "$(git status --porcelain)" ]]; then | |
| echo "Error: Generated files are not up to date!" | |
| echo "The following files have changes:" | |
| git status --porcelain | |
| echo "" | |
| echo "Please regenerate the files locally with (pnpm run generate) and commit the changes." | |
| git diff | |
| exit 1 | |
| else | |
| echo "✅ Generated files are up to date!" | |
| fi | |
| # Non-blocking quality reports: they surface findings without making CI fail. | |
| # Tighten Knip to blocking once its existing findings are triaged. | |
| knip: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| persist-credentials: false | |
| - name: Setup | |
| uses: ./tooling/github/setup | |
| - name: Knip (unused files / deps / exports, report-only) | |
| # The existing baseline is intentionally advisory. Keep its findings in | |
| # the log and Actions annotations without making the check non-green. | |
| run: pnpm knip || echo "::warning title=Knip findings::Knip reported existing unused-code findings. See this step's log for details." | |
| react-doctor: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| persist-credentials: false | |
| - name: Setup | |
| uses: ./tooling/github/setup | |
| - name: "React Doctor (minimum score: 99)" | |
| run: pnpm doctor:ci |