Skip to content

Commit

Permalink
Merge pull request zcash#6794 from zcash/ci_gtest_sharding
Browse files Browse the repository at this point in the history
CI: Add sharding to GoogleTest job
  • Loading branch information
Yasser Isa authored Dec 15, 2023
2 parents afce2a0 + 3469340 commit 0b61fe5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,15 @@ jobs:
outputs:
build_matrix: ${{ steps.set-matrices.outputs.build_matrix }}
test_matrix: ${{ steps.set-matrices.outputs.test_matrix }}
test_names: ${{ steps.set-matrices.outputs.test_names }}
steps:
- id: set-matrices
env:
CFG: ${{ toJSON(matrix.cfg) }}
run: |
jq -r -n 'env.CFG | fromjson | @json "build_matrix=\(.data)"' >> $GITHUB_OUTPUT
jq -r -n 'env.CFG | fromjson | [.data[] | select(.test_os)] | @json "test_matrix=\(.)"' >> $GITHUB_OUTPUT
jq -r -n 'env.CFG | fromjson | [.data[] | select(.test_os) | .name] | @json "test_names=\(.)"' >> $GITHUB_OUTPUT
build:
name: Build tier ${{ matrix.tier }} platform ${{ matrix.platform }}
Expand Down Expand Up @@ -240,12 +242,14 @@ jobs:
run: ${{ format('./test_bitcoin{0}', matrix.file_ext) }} -p

test-gtest:
name: GoogleTest tier ${{ matrix.tier }} platform ${{ matrix.platform }}
name: GoogleTest tier ${{ matrix.tier }} platform ${{ matrix.platform }} - shard ${{ matrix.gtest_shards }}
needs: [matrices, build]
runs-on: ${{ matrix.test_os }}
continue-on-error: ${{ matrix.tier != 1 }}
strategy:
matrix:
name: ${{ fromJson(needs.matrices.outputs.test_names) }}
shard_index: [0, 1]
include: ${{ fromJson(needs.matrices.outputs.test_matrix) }}
steps:
- name: Download zcash-gtest artifact
Expand Down Expand Up @@ -274,4 +278,7 @@ jobs:
runner.os == 'Linux' && '.zcash-params' || 'ZcashParams'
}}
- name: Run GoogleTests
env:
GTEST_TOTAL_SHARDS: 2
GTEST_SHARD_INDEX: ${{ matrix.shard_index }}
run: ${{ format('./zcash-gtest{0}', matrix.file_ext) }}

0 comments on commit 0b61fe5

Please sign in to comment.