|
10 | 10 | unitTests: |
11 | 11 | name: "🧪 Unit Tests" |
12 | 12 | runs-on: ubuntu-latest |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + shardIndex: [1, 2, 3, 4, 5] |
| 16 | + shardTotal: [5] |
13 | 17 | env: |
14 | 18 | DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} |
| 19 | + SHARD_INDEX: ${{ matrix.shardIndex }} |
| 20 | + SHARD_TOTAL: ${{ matrix.shardTotal }} |
15 | 21 | steps: |
16 | 22 | - name: 🔧 Disable IPv6 |
17 | 23 | run: | |
|
73 | 79 | run: pnpm run generate |
74 | 80 |
|
75 | 81 | - name: 🧪 Run Webapp Unit Tests |
76 | | - run: pnpm run test:webapp |
| 82 | + run: pnpm run test:webapp -- --reporter=blob --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} |
77 | 83 | env: |
78 | 84 | DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres |
79 | 85 | DIRECT_URL: postgresql://postgres:postgres@localhost:5432/postgres |
|
82 | 88 | ENCRYPTION_KEY: "secret" |
83 | 89 |
|
84 | 90 | - name: 🧪 Run Package Unit Tests |
85 | | - run: pnpm run test:packages |
| 91 | + run: pnpm run test:packages -- --reporter=blob --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} |
86 | 92 |
|
87 | 93 | - name: 🧪 Run Internal Unit Tests |
88 | | - run: pnpm run test:internal |
| 94 | + run: pnpm run test:internal -- --reporter=blob --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} |
| 95 | + |
| 96 | + - name: Upload blob report to GitHub Actions Artifacts |
| 97 | + if: ${{ !cancelled() }} |
| 98 | + uses: actions/upload-artifact@v4 |
| 99 | + with: |
| 100 | + name: blob-report-${{ matrix.shardIndex }} |
| 101 | + path: .vitest-reports/* |
| 102 | + include-hidden-files: true |
| 103 | + retention-days: 1 |
| 104 | + |
| 105 | + merge-reports: |
| 106 | + if: ${{ !cancelled() }} |
| 107 | + needs: [unitTests] |
| 108 | + runs-on: ubuntu-latest |
| 109 | + steps: |
| 110 | + - name: ⬇️ Checkout repo |
| 111 | + uses: actions/checkout@v4 |
| 112 | + with: |
| 113 | + fetch-depth: 0 |
| 114 | + |
| 115 | + - name: ⎔ Setup pnpm |
| 116 | + uses: pnpm/action-setup@v4 |
| 117 | + with: |
| 118 | + version: 8.15.5 |
| 119 | + |
| 120 | + - name: ⎔ Setup node |
| 121 | + uses: buildjet/setup-node@v4 |
| 122 | + with: |
| 123 | + node-version: 20.11.1 |
| 124 | + cache: "pnpm" |
| 125 | + |
| 126 | + - name: 📥 Download deps |
| 127 | + run: pnpm install --frozen-lockfile |
| 128 | + |
| 129 | + - name: Download blob reports from GitHub Actions Artifacts |
| 130 | + uses: actions/download-artifact@v4 |
| 131 | + with: |
| 132 | + path: .vitest-reports |
| 133 | + pattern: blob-report-* |
| 134 | + merge-multiple: true |
| 135 | + |
| 136 | + - name: Merge reports |
| 137 | + run: npx vitest --merge-reports |
0 commit comments