|
4 | 4 | schedule: |
5 | 5 | - cron: '0 0 1,15 * *' |
6 | 6 | jobs: |
| 7 | + jest-config: |
| 8 | + name: Configure Jest |
| 9 | + runs-on: ubuntu-24.04 |
| 10 | + timeout-minutes: 5 |
| 11 | + outputs: |
| 12 | + jest_test_matrix: ${{ steps.jest_test_config.outputs.jest_test_matrix }} |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 |
| 15 | + name: Checkout sentry |
| 16 | + |
| 17 | + - uses: ./.github/actions/setup-node-pnpm |
| 18 | + |
| 19 | + - name: Jest Test Config |
| 20 | + id: jest_test_config |
| 21 | + env: |
| 22 | + FRONTEND_ALL_FILES: '' |
| 23 | + run: ./.github/workflows/scripts/jest-test-config.sh |
| 24 | + |
| 25 | + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # 4.6.2 |
| 26 | + name: Upload jest test file list |
| 27 | + with: |
| 28 | + name: jest-test-files |
| 29 | + path: jest-test-files.json |
| 30 | + if-no-files-found: ignore |
| 31 | + retention-days: 1 |
| 32 | + |
7 | 33 | jest-balance: |
8 | | - # Buckle up, this may take a while |
| 34 | + needs: jest-config |
9 | 35 | timeout-minutes: 60 |
10 | 36 | # Make sure this matches the runner that runs frontend tests |
11 | 37 | runs-on: ubuntu-24.04 |
| 38 | + strategy: |
| 39 | + fail-fast: false |
| 40 | + matrix: ${{ fromJson(needs.jest-config.outputs.jest_test_matrix) }} |
12 | 41 | steps: |
13 | 42 | - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 |
| 43 | + name: Checkout sentry |
14 | 44 |
|
15 | 45 | - uses: ./.github/actions/setup-node-pnpm |
16 | 46 |
|
17 | | - - name: jest balancer |
| 47 | + - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 |
| 48 | + name: Download jest-test-files.json |
| 49 | + with: |
| 50 | + name: jest-test-files |
| 51 | + path: . |
| 52 | + |
| 53 | + - name: Download jest-balance.json |
| 54 | + uses: dawidd6/action-download-artifact@ac66b43f0e6a346234dd65d4d0c8fbb31cb316e5 # v11 |
| 55 | + with: |
| 56 | + workflow: 38531594 # jest-balancer.yml |
| 57 | + workflow_conclusion: success |
| 58 | + branch: master |
| 59 | + name: jest-balance.json |
| 60 | + name_is_regexp: false |
| 61 | + path: tests/js/test-balancer/ |
| 62 | + search_artifacts: true |
| 63 | + if_no_artifact_found: warn |
| 64 | + |
| 65 | + - name: jest balancer (shard ${{ matrix.index }}/${{ matrix.total }}) |
| 66 | + continue-on-error: true |
18 | 67 | env: |
| 68 | + SENTRY_DSN: ${{ secrets.SENTRY_JEST_DSN }} |
| 69 | + |
| 70 | + CI_NODE_TOTAL: ${{ matrix.total }} |
| 71 | + CI_NODE_INDEX: ${{ matrix.index }} |
| 72 | + |
19 | 73 | GITHUB_PR_SHA: ${{ github.event.pull_request.head.sha || github.sha }} |
20 | 74 | GITHUB_PR_REF: ${{ github.event.pull_request.head.ref || github.ref }} |
21 | | - SENTRY_DSN: ${{ secrets.SENTRY_JEST_DSN }} |
22 | | - run: pnpm run test-ci --testResultsProcessor ./tests/js/test-balancer/index.js |
| 75 | + run: pnpm run test-ci --forceExit --testResultsProcessor ./tests/js/test-balancer/resultsProcessor.ts |
23 | 76 |
|
24 | 77 | - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # 4.6.2 |
25 | 78 | with: |
26 | | - name: jest-balance.json |
| 79 | + name: jest-balance-${{ matrix.index }} |
27 | 80 | path: tests/js/test-balancer/jest-balance.json |
| 81 | + |
| 82 | + combine-balance: |
| 83 | + needs: jest-balance |
| 84 | + runs-on: ubuntu-24.04 |
| 85 | + steps: |
| 86 | + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 |
| 87 | + |
| 88 | + - uses: ./.github/actions/setup-node-pnpm |
| 89 | + |
| 90 | + - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 |
| 91 | + with: |
| 92 | + path: artifacts |
| 93 | + pattern: jest-balance-* |
| 94 | + |
| 95 | + - name: Combine balance files |
| 96 | + run: node tests/js/test-balancer/combine.ts artifacts |
| 97 | + |
| 98 | + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # 4.6.2 |
| 99 | + with: |
| 100 | + name: jest-balance.json |
| 101 | + path: jest-balance.json |
0 commit comments