|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + branches: [main] |
| 8 | + |
| 9 | +permissions: {} |
| 10 | + |
| 11 | +jobs: |
| 12 | + typecheck: |
| 13 | + name: Type Check |
| 14 | + runs-on: ubuntu-latest |
| 15 | + defaults: |
| 16 | + run: |
| 17 | + working-directory: ./apps/web |
| 18 | + steps: |
| 19 | + - name: Checkout code |
| 20 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| 21 | + |
| 22 | + - name: Setup Node.js |
| 23 | + uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 |
| 24 | + with: |
| 25 | + node-version: '22' |
| 26 | + cache: 'npm' |
| 27 | + cache-dependency-path: ./apps/web/package-lock.json |
| 28 | + |
| 29 | + - name: Install dependencies |
| 30 | + run: npm ci |
| 31 | + |
| 32 | + - name: Run type check |
| 33 | + run: npm run typecheck |
| 34 | + |
| 35 | + test: |
| 36 | + name: Unit Tests |
| 37 | + runs-on: ubuntu-latest |
| 38 | + defaults: |
| 39 | + run: |
| 40 | + working-directory: ./apps/web |
| 41 | + steps: |
| 42 | + - name: Checkout code |
| 43 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| 44 | + |
| 45 | + - name: Setup Node.js |
| 46 | + uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 |
| 47 | + with: |
| 48 | + node-version: '22' |
| 49 | + cache: 'npm' |
| 50 | + cache-dependency-path: ./apps/web/package-lock.json |
| 51 | + |
| 52 | + - name: Install dependencies |
| 53 | + run: npm ci |
| 54 | + |
| 55 | + - name: Run tests |
| 56 | + run: npx vitest run --coverage |
| 57 | + |
| 58 | + - name: Upload coverage to Codecov |
| 59 | + uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 |
| 60 | + with: |
| 61 | + files: ./apps/web/coverage/lcov.info |
| 62 | + fail_ci_if_error: false |
| 63 | + env: |
| 64 | + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
| 65 | + |
| 66 | + build: |
| 67 | + name: Production Build |
| 68 | + runs-on: ubuntu-latest |
| 69 | + defaults: |
| 70 | + run: |
| 71 | + working-directory: ./apps/web |
| 72 | + steps: |
| 73 | + - name: Checkout code |
| 74 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| 75 | + |
| 76 | + - name: Setup Node.js |
| 77 | + uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 |
| 78 | + with: |
| 79 | + node-version: '22' |
| 80 | + cache: 'npm' |
| 81 | + cache-dependency-path: ./apps/web/package-lock.json |
| 82 | + |
| 83 | + - name: Install dependencies |
| 84 | + run: npm ci |
| 85 | + |
| 86 | + - name: Build project |
| 87 | + run: npm run build |
| 88 | + |
| 89 | + lint: |
| 90 | + name: Lint |
| 91 | + runs-on: ubuntu-latest |
| 92 | + defaults: |
| 93 | + run: |
| 94 | + working-directory: ./apps/web |
| 95 | + steps: |
| 96 | + - name: Checkout code |
| 97 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| 98 | + |
| 99 | + - name: Setup Node.js |
| 100 | + uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 |
| 101 | + with: |
| 102 | + node-version: '22' |
| 103 | + cache: 'npm' |
| 104 | + cache-dependency-path: ./apps/web/package-lock.json |
| 105 | + |
| 106 | + - name: Install dependencies |
| 107 | + run: npm ci |
| 108 | + |
| 109 | + - name: Run lint |
| 110 | + run: npm run lint |
| 111 | + |
| 112 | + e2e: |
| 113 | + name: E2E Tests |
| 114 | + needs: [typecheck, test, lint] |
| 115 | + runs-on: ubuntu-latest |
| 116 | + defaults: |
| 117 | + run: |
| 118 | + working-directory: ./apps/web |
| 119 | + steps: |
| 120 | + - name: Checkout code |
| 121 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| 122 | + |
| 123 | + - name: Setup Node.js |
| 124 | + uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 |
| 125 | + with: |
| 126 | + node-version: '22' |
| 127 | + cache: 'npm' |
| 128 | + cache-dependency-path: ./apps/web/package-lock.json |
| 129 | + |
| 130 | + - name: Install dependencies |
| 131 | + run: npm ci |
| 132 | + |
| 133 | + - name: Install Playwright browsers |
| 134 | + run: npx playwright install --with-deps chromium |
| 135 | + |
| 136 | + - name: Run E2E tests |
| 137 | + run: npm run e2e |
| 138 | + |
| 139 | + - name: Upload Playwright report |
| 140 | + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 |
| 141 | + if: ${{ !cancelled() }} |
| 142 | + with: |
| 143 | + name: playwright-report |
| 144 | + path: apps/web/playwright-report/ |
| 145 | + retention-days: 14 |
| 146 | + |
| 147 | + - name: Upload E2E screenshots |
| 148 | + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 |
| 149 | + if: ${{ !cancelled() }} |
| 150 | + with: |
| 151 | + name: e2e-screenshots |
| 152 | + path: apps/web/e2e/screenshots/ |
| 153 | + retention-days: 14 |
0 commit comments