|
9 | 9 | required: false |
10 | 10 | type: number |
11 | 11 | default: 6 |
| 12 | + ut_sharded: |
| 13 | + description: "Run the complete race UT suite as three disjoint parallel shards" |
| 14 | + required: false |
| 15 | + type: boolean |
| 16 | + default: false |
12 | 17 | secrets: |
13 | 18 | TOKEN_ACTION: |
14 | 19 | description: "Token for checkout (e.g. pull from fork/private)" |
|
45 | 50 | required: true |
46 | 51 |
|
47 | 52 | jobs: |
48 | | - ut-linux-x86: |
| 53 | + ut-linux-x86-shard: |
| 54 | + strategy: |
| 55 | + fail-fast: false |
| 56 | + matrix: |
| 57 | + ut_shard: ${{ fromJSON(inputs.ut_sharded && '["light","issues","embedded","heavy-plan"]' || '["all"]') }} |
49 | 58 | environment: ci |
50 | 59 | runs-on: ${{ vars.UT_RUNNER_LABEL || 'ubuntu-22.04' }} |
51 | | - name: UT Test on Ubuntu/x86 |
| 60 | + name: UT Test shard ${{ matrix.ut_shard }} on Ubuntu/x86 |
52 | 61 | steps: |
53 | 62 | - name: Pre Clean Some Unneeded Images |
54 | 63 | run: | |
@@ -259,7 +268,7 @@ jobs: |
259 | 268 | cd $GITHUB_WORKSPACE && make clean && time make config |
260 | 269 | # Keep the repository variable as the operational override while |
261 | 270 | # allowing callers to run a scoped parallelism experiment. |
262 | | - time make ut UT_CONFIGURED=1 UT_PARALLEL=${{ vars.UT_PARALLEL || inputs.ut_parallel }} UT_TIMEOUT=${{ vars.UT_TIMEOUT || 40 }} |
| 271 | + time make ut UT_CONFIGURED=1 UT_PARALLEL=${{ vars.UT_PARALLEL || inputs.ut_parallel }} UT_TIMEOUT=${{ vars.UT_TIMEOUT || 40 }} UT_SHARD=${{ matrix.ut_shard }} |
263 | 272 | - name: Print Result(Old) |
264 | 273 | if: ${{ always() }} |
265 | 274 | continue-on-error: true |
@@ -308,6 +317,25 @@ jobs: |
308 | 317 | run: | |
309 | 318 | find ./ut-report -name top.txt -exec cat {} \; |
310 | 319 |
|
| 320 | + # Preserve the established required-check name and make it an AND gate over |
| 321 | + # every shard. fail-fast=false above ensures one failure cannot hide missing |
| 322 | + # coverage by cancelling the other shards. |
| 323 | + ut-linux-x86: |
| 324 | + if: ${{ always() }} |
| 325 | + needs: ut-linux-x86-shard |
| 326 | + runs-on: ubuntu-22.04 |
| 327 | + name: UT Test on Ubuntu/x86 |
| 328 | + steps: |
| 329 | + - name: Require every UT shard |
| 330 | + env: |
| 331 | + UT_SHARD_RESULT: ${{ needs.ut-linux-x86-shard.result }} |
| 332 | + run: | |
| 333 | + if [[ "${UT_SHARD_RESULT}" != "success" ]]; then |
| 334 | + echo "One or more UT shards did not succeed: ${UT_SHARD_RESULT}" |
| 335 | + exit 1 |
| 336 | + fi |
| 337 | + echo "Every UT shard succeeded" |
| 338 | +
|
311 | 339 | ut-mac-x86: |
312 | 340 | #if: ${{ !github.event.pull_request.draft }} |
313 | 341 | if: ${{ false }} |
|
0 commit comments