Skip to content

Commit 97fb41e

Browse files
committed
ci: shard race UT critical path
1 parent 145c6f6 commit 97fb41e

1 file changed

Lines changed: 31 additions & 3 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ on:
99
required: false
1010
type: number
1111
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
1217
secrets:
1318
TOKEN_ACTION:
1419
description: "Token for checkout (e.g. pull from fork/private)"
@@ -45,10 +50,14 @@ on:
4550
required: true
4651

4752
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"]') }}
4958
environment: ci
5059
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
5261
steps:
5362
- name: Pre Clean Some Unneeded Images
5463
run: |
@@ -259,7 +268,7 @@ jobs:
259268
cd $GITHUB_WORKSPACE && make clean && time make config
260269
# Keep the repository variable as the operational override while
261270
# 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 }}
263272
- name: Print Result(Old)
264273
if: ${{ always() }}
265274
continue-on-error: true
@@ -308,6 +317,25 @@ jobs:
308317
run: |
309318
find ./ut-report -name top.txt -exec cat {} \;
310319
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+
311339
ut-mac-x86:
312340
#if: ${{ !github.event.pull_request.draft }}
313341
if: ${{ false }}

0 commit comments

Comments
 (0)