Skip to content

Commit

Permalink
CI: Run bitrot build jobs in parallel
Browse files Browse the repository at this point in the history
These were previously run serially in the same job to take advantage of
caching from earlier build files. However, after the main build was
split into a separate job, `actions/cache` is primed by it, so all of
the bitrot tests are going to start with caches and don't need to rely
on cross-build-flag caching.
  • Loading branch information
str4d committed Jan 2, 2024
1 parent ab2a77b commit 399353c
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:

outputs:
build_matrix: ${{ steps.set-matrices.outputs.build_matrix }}
build_names: ${{ steps.set-matrices.outputs.build_names }}
test_matrix: ${{ steps.set-matrices.outputs.test_matrix }}
test_names: ${{ steps.set-matrices.outputs.test_names }}
steps:
Expand All @@ -65,6 +66,7 @@ jobs:
CFG: ${{ toJSON(matrix.cfg) }}
run: |
jq -r -n 'env.CFG | fromjson | @json "build_matrix=\(.data)"' >> $GITHUB_OUTPUT
jq -r -n 'env.CFG | fromjson | [.data[] | .name] | @json "build_names=\(.)"' >> $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
Expand Down Expand Up @@ -150,12 +152,17 @@ jobs:
path: ${{ format('src/zcash-gtest{0}', matrix.file_ext) }}

bitrot:
name: Bitrot check tier ${{ matrix.tier }} platform ${{ matrix.platform }}
name: Bitrot check tier ${{ matrix.tier }} platform ${{ matrix.platform }} flag '${{ matrix.configure_flag }}'
needs: [matrices, build]
runs-on: ${{ matrix.build_os }}
continue-on-error: ${{ matrix.tier == 3 }}
strategy:
matrix:
name: ${{ fromJson(needs.matrices.outputs.build_names) }}
configure_flag:
- '--with-libs'
- '--disable-wallet'
- '--disable-mining'
include: ${{ fromJson(needs.matrices.outputs.build_matrix) }}

steps:
Expand Down Expand Up @@ -201,23 +208,9 @@ jobs:
shell: bash
run: echo "count=$(nproc 2> /dev/null || sysctl -n hw.logicalcpu)" >> "$GITHUB_OUTPUT"

- name: Build zcashd with libraries enabled
- name: Build zcashd with the flag being checked
run: >
CONFIGURE_FLAGS="--with-libs"
${{ matrix.host }}
./zcutil/build.sh
-j"${{ steps.nproc.outputs.count }}"
- name: Build zcashd with wallet disabled
run: >
CONFIGURE_FLAGS="--disable-wallet"
${{ matrix.host }}
./zcutil/build.sh
-j"${{ steps.nproc.outputs.count }}"
- name: Build zcashd with mining disabled
run: >
CONFIGURE_FLAGS="--disable-mining"
CONFIGURE_FLAGS="${{ matrix.configure_flag }}"
${{ matrix.host }}
./zcutil/build.sh
-j"${{ steps.nproc.outputs.count }}"
Expand Down

0 comments on commit 399353c

Please sign in to comment.