|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: ["**"] |
| 6 | + push: |
| 7 | + branches: ["main", "develop"] |
| 8 | + |
| 9 | +permissions: read-all |
| 10 | + |
| 11 | +concurrency: |
| 12 | + group: ci-${{ github.workflow }}-${{ github.ref }} |
| 13 | + cancel-in-progress: true |
| 14 | + |
| 15 | +jobs: |
| 16 | + frontend: |
| 17 | + name: Frontend (Node ${{ matrix.node-version }}) |
| 18 | + runs-on: ubuntu-latest |
| 19 | + env: |
| 20 | + CI: true |
| 21 | + strategy: |
| 22 | + matrix: |
| 23 | + node-version: [18.x, 20.x] |
| 24 | + defaults: |
| 25 | + run: |
| 26 | + working-directory: frontend |
| 27 | + steps: |
| 28 | + - name: Checkout |
| 29 | + uses: actions/checkout@v4 |
| 30 | + - name: Setup Node |
| 31 | + uses: actions/setup-node@v4 |
| 32 | + with: |
| 33 | + node-version: ${{ matrix.node-version }} |
| 34 | + cache: npm |
| 35 | + cache-dependency-path: frontend/package-lock.json |
| 36 | + - name: Install deps |
| 37 | + run: npm ci |
| 38 | + - name: Typecheck |
| 39 | + run: npm run typecheck |
| 40 | + - name: Run tests |
| 41 | + run: npm run test:run -- --reporter=verbose |
| 42 | + - name: Coverage |
| 43 | + run: npm run test:coverage |
| 44 | + - name: Upload coverage artifact |
| 45 | + if: always() |
| 46 | + uses: actions/upload-artifact@v4 |
| 47 | + with: |
| 48 | + name: frontend-coverage-${{ matrix.node-version }} |
| 49 | + path: frontend/coverage |
| 50 | + |
| 51 | + backend: |
| 52 | + name: Backend (Node ${{ matrix.node-version }}) |
| 53 | + runs-on: ubuntu-latest |
| 54 | + env: |
| 55 | + CI: true |
| 56 | + strategy: |
| 57 | + matrix: |
| 58 | + node-version: [18.x, 20.x] |
| 59 | + defaults: |
| 60 | + run: |
| 61 | + working-directory: backend |
| 62 | + steps: |
| 63 | + - name: Checkout |
| 64 | + uses: actions/checkout@v4 |
| 65 | + - name: Setup Node |
| 66 | + uses: actions/setup-node@v4 |
| 67 | + with: |
| 68 | + node-version: ${{ matrix.node-version }} |
| 69 | + cache: npm |
| 70 | + cache-dependency-path: backend/package-lock.json |
| 71 | + - name: Install deps |
| 72 | + run: npm ci |
| 73 | + - name: Run tests |
| 74 | + run: npm test |
| 75 | + - name: Coverage |
| 76 | + run: npm run test:coverage |
| 77 | + - name: Upload coverage artifact |
| 78 | + if: always() |
| 79 | + uses: actions/upload-artifact@v4 |
| 80 | + with: |
| 81 | + name: backend-coverage-${{ matrix.node-version }} |
| 82 | + path: backend/coverage |
0 commit comments