|
| 1 | +name: CI PR |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: [main] |
| 6 | + push: |
| 7 | + branches: [main] |
| 8 | + |
| 9 | +concurrency: |
| 10 | + group: ci-pr-${{ github.ref }} |
| 11 | + cancel-in-progress: true |
| 12 | + |
| 13 | +jobs: |
| 14 | + quick-gate: |
| 15 | + name: Lint + Typecheck (Fail Fast) |
| 16 | + runs-on: ubuntu-latest |
| 17 | + timeout-minutes: 8 |
| 18 | + steps: |
| 19 | + - name: Checkout |
| 20 | + uses: actions/checkout@v4 |
| 21 | + |
| 22 | + - name: Setup Bun |
| 23 | + uses: oven-sh/setup-bun@v2 |
| 24 | + with: |
| 25 | + bun-version: 1.1.38 |
| 26 | + |
| 27 | + - name: Cache Bun and node_modules |
| 28 | + uses: actions/cache@v4 |
| 29 | + with: |
| 30 | + path: | |
| 31 | + ~/.bun/install/cache |
| 32 | + node_modules |
| 33 | + key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }} |
| 34 | + |
| 35 | + - name: Install dependencies |
| 36 | + run: bun install --frozen-lockfile |
| 37 | + |
| 38 | + - name: Lint |
| 39 | + run: bun run lint |
| 40 | + |
| 41 | + - name: Typecheck |
| 42 | + run: bun run typecheck |
| 43 | + |
| 44 | + unit-tests: |
| 45 | + name: Unit Tests |
| 46 | + needs: quick-gate |
| 47 | + runs-on: ubuntu-latest |
| 48 | + timeout-minutes: 10 |
| 49 | + steps: |
| 50 | + - name: Checkout |
| 51 | + uses: actions/checkout@v4 |
| 52 | + |
| 53 | + - name: Setup Bun |
| 54 | + uses: oven-sh/setup-bun@v2 |
| 55 | + with: |
| 56 | + bun-version: 1.1.38 |
| 57 | + |
| 58 | + - name: Cache Bun and node_modules |
| 59 | + uses: actions/cache@v4 |
| 60 | + with: |
| 61 | + path: | |
| 62 | + ~/.bun/install/cache |
| 63 | + node_modules |
| 64 | + key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }} |
| 65 | + |
| 66 | + - name: Install dependencies |
| 67 | + run: bun install --frozen-lockfile |
| 68 | + |
| 69 | + - name: Run unit tests |
| 70 | + run: bun run test:unit |
| 71 | + |
| 72 | + integration-tests: |
| 73 | + name: Integration Tests |
| 74 | + needs: quick-gate |
| 75 | + runs-on: ubuntu-latest |
| 76 | + timeout-minutes: 12 |
| 77 | + steps: |
| 78 | + - name: Checkout |
| 79 | + uses: actions/checkout@v4 |
| 80 | + |
| 81 | + - name: Setup Bun |
| 82 | + uses: oven-sh/setup-bun@v2 |
| 83 | + with: |
| 84 | + bun-version: 1.1.38 |
| 85 | + |
| 86 | + - name: Cache Bun and node_modules |
| 87 | + uses: actions/cache@v4 |
| 88 | + with: |
| 89 | + path: | |
| 90 | + ~/.bun/install/cache |
| 91 | + node_modules |
| 92 | + key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }} |
| 93 | + |
| 94 | + - name: Install dependencies |
| 95 | + run: bun install --frozen-lockfile |
| 96 | + |
| 97 | + - name: Run integration tests |
| 98 | + run: bun run test:integration |
| 99 | + |
| 100 | + coverage-gate: |
| 101 | + name: Coverage Gate |
| 102 | + needs: [unit-tests, integration-tests] |
| 103 | + runs-on: ubuntu-latest |
| 104 | + timeout-minutes: 10 |
| 105 | + steps: |
| 106 | + - name: Checkout |
| 107 | + uses: actions/checkout@v4 |
| 108 | + |
| 109 | + - name: Setup Bun |
| 110 | + uses: oven-sh/setup-bun@v2 |
| 111 | + with: |
| 112 | + bun-version: 1.1.38 |
| 113 | + |
| 114 | + - name: Cache Bun and node_modules |
| 115 | + uses: actions/cache@v4 |
| 116 | + with: |
| 117 | + path: | |
| 118 | + ~/.bun/install/cache |
| 119 | + node_modules |
| 120 | + key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }} |
| 121 | + |
| 122 | + - name: Install dependencies |
| 123 | + run: bun install --frozen-lockfile |
| 124 | + |
| 125 | + - name: Run full coverage gate |
| 126 | + run: bun run test |
| 127 | + |
| 128 | + - name: Upload coverage report |
| 129 | + uses: actions/upload-artifact@v4 |
| 130 | + if: always() |
| 131 | + with: |
| 132 | + name: coverage-full |
| 133 | + path: coverage |
0 commit comments