|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - master |
| 8 | + pull_request: |
| 9 | + branches: |
| 10 | + - master |
| 11 | + |
| 12 | +concurrency: |
| 13 | + group: "${{ github.workflow }}-${{ github.head_ref }}" |
| 14 | + cancel-in-progress: ${{ github.event_name == 'pull_request' }} |
| 15 | + |
| 16 | +permissions: {} |
| 17 | + |
| 18 | +jobs: |
| 19 | + build-and-test: |
| 20 | + name: Build and test ${{ matrix.node }} on ${{ matrix.os }} |
| 21 | + |
| 22 | + strategy: |
| 23 | + fail-fast: false |
| 24 | + matrix: |
| 25 | + node: [24] |
| 26 | + os: [ubuntu-latest, macos-latest] |
| 27 | + runs-on: ${{ matrix.os }} |
| 28 | + |
| 29 | + permissions: |
| 30 | + contents: read |
| 31 | + |
| 32 | + steps: |
| 33 | + - name: Checkout code |
| 34 | + uses: actions/checkout@v6 |
| 35 | + |
| 36 | + - name: Run vercel-preparation.sh |
| 37 | + run: | |
| 38 | + chmod +x ./vercel-preparation.sh |
| 39 | + ./vercel-preparation.sh |
| 40 | +
|
| 41 | + - name: Install Dependencies |
| 42 | + uses: ./.github/actions/install-dependencies |
| 43 | + with: |
| 44 | + node-version: ${{ matrix.node }} |
| 45 | + |
| 46 | + - name: Build frontend |
| 47 | + run: pnpm --filter frontend run build |
| 48 | + |
| 49 | + - name: Run frontend tests |
| 50 | + run: pnpm --filter frontend run test |
| 51 | + |
| 52 | + - name: Run backend tests |
| 53 | + run: pnpm --filter github-readme-stats run test |
| 54 | + |
| 55 | + frontend-test-e2e: |
| 56 | + name: Frontend E2E test |
| 57 | + |
| 58 | + permissions: |
| 59 | + contents: read |
| 60 | + |
| 61 | + timeout-minutes: 60 |
| 62 | + |
| 63 | + runs-on: ubuntu-latest |
| 64 | + |
| 65 | + steps: |
| 66 | + - name: Checkout code |
| 67 | + uses: actions/checkout@v6 |
| 68 | + |
| 69 | + - name: Install Dependencies |
| 70 | + uses: ./.github/actions/install-dependencies |
| 71 | + |
| 72 | + - name: Run vercel-preparation.sh |
| 73 | + run: | |
| 74 | + chmod +x ./vercel-preparation.sh |
| 75 | + ./vercel-preparation.sh |
| 76 | +
|
| 77 | + - name: Install Playwright Browsers |
| 78 | + run: pnpm exec playwright install --with-deps |
| 79 | + |
| 80 | + - name: Run Playwright tests |
| 81 | + run: pnpm --filter frontend run test:e2e |
| 82 | + |
| 83 | + code-checks: |
| 84 | + name: Code checks |
| 85 | + |
| 86 | + runs-on: ubuntu-latest |
| 87 | + |
| 88 | + permissions: |
| 89 | + contents: read |
| 90 | + |
| 91 | + steps: |
| 92 | + - name: Checkout code |
| 93 | + uses: actions/checkout@v6 |
| 94 | + |
| 95 | + # Heads up! |
| 96 | + # |
| 97 | + # 1. Execution of this script is needed to resolve `.vercel` folder from `apps/frontend/src/components/Card/SVG.js` |
| 98 | + # 2. This scripts removes `apps/backend/node_modules` breaking ESLint’s module resolution. |
| 99 | + # Dependency installation must occur after running ./vercel-preparation.sh. |
| 100 | + - name: Run vercel-preparation.sh |
| 101 | + run: | |
| 102 | + chmod +x ./vercel-preparation.sh |
| 103 | + ./vercel-preparation.sh |
| 104 | +
|
| 105 | + - name: Install Dependencies |
| 106 | + uses: ./.github/actions/install-dependencies |
| 107 | + |
| 108 | + - name: Format |
| 109 | + run: pnpm run format:check |
| 110 | + |
| 111 | + - name: Lint |
| 112 | + run: pnpm run lint |
| 113 | + |
| 114 | + - name: Lint (knip) |
| 115 | + run: pnpm run lint:knip |
| 116 | + |
| 117 | + - name: Typecheck |
| 118 | + run: pnpm run typecheck |
0 commit comments