Skip to content

Commit 0b61fe5

Browse files
author
Yasser Isa
authored
Merge pull request zcash#6794 from zcash/ci_gtest_sharding
CI: Add sharding to GoogleTest job
2 parents afce2a0 + 3469340 commit 0b61fe5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,15 @@ jobs:
5858
outputs:
5959
build_matrix: ${{ steps.set-matrices.outputs.build_matrix }}
6060
test_matrix: ${{ steps.set-matrices.outputs.test_matrix }}
61+
test_names: ${{ steps.set-matrices.outputs.test_names }}
6162
steps:
6263
- id: set-matrices
6364
env:
6465
CFG: ${{ toJSON(matrix.cfg) }}
6566
run: |
6667
jq -r -n 'env.CFG | fromjson | @json "build_matrix=\(.data)"' >> $GITHUB_OUTPUT
6768
jq -r -n 'env.CFG | fromjson | [.data[] | select(.test_os)] | @json "test_matrix=\(.)"' >> $GITHUB_OUTPUT
69+
jq -r -n 'env.CFG | fromjson | [.data[] | select(.test_os) | .name] | @json "test_names=\(.)"' >> $GITHUB_OUTPUT
6870
6971
build:
7072
name: Build tier ${{ matrix.tier }} platform ${{ matrix.platform }}
@@ -240,12 +242,14 @@ jobs:
240242
run: ${{ format('./test_bitcoin{0}', matrix.file_ext) }} -p
241243

242244
test-gtest:
243-
name: GoogleTest tier ${{ matrix.tier }} platform ${{ matrix.platform }}
245+
name: GoogleTest tier ${{ matrix.tier }} platform ${{ matrix.platform }} - shard ${{ matrix.gtest_shards }}
244246
needs: [matrices, build]
245247
runs-on: ${{ matrix.test_os }}
246248
continue-on-error: ${{ matrix.tier != 1 }}
247249
strategy:
248250
matrix:
251+
name: ${{ fromJson(needs.matrices.outputs.test_names) }}
252+
shard_index: [0, 1]
249253
include: ${{ fromJson(needs.matrices.outputs.test_matrix) }}
250254
steps:
251255
- name: Download zcash-gtest artifact
@@ -274,4 +278,7 @@ jobs:
274278
runner.os == 'Linux' && '.zcash-params' || 'ZcashParams'
275279
}}
276280
- name: Run GoogleTests
281+
env:
282+
GTEST_TOTAL_SHARDS: 2
283+
GTEST_SHARD_INDEX: ${{ matrix.shard_index }}
277284
run: ${{ format('./zcash-gtest{0}', matrix.file_ext) }}

0 commit comments

Comments
 (0)