From d34d84380e63efa467baeb36acc038fce5c99a3c Mon Sep 17 00:00:00 2001 From: Daira-Emma Hopwood Date: Mon, 9 Dec 2024 21:29:39 +0000 Subject: [PATCH 1/4] Move expensive tests to another task. fixes #1639 Signed-off-by: Daira-Emma Hopwood --- .github/workflows/ci.yml | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef0260e5f6..e54a436061 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,6 +66,49 @@ jobs: cargo test --workspace ${{ steps.prepare.outputs.feature-flags }} + - name: Verify working directory is clean + run: git diff --exit-code + + test-slow: + name: Slow Test + runs-on: ${{ matrix.os }} + continue-on-error: true + strategy: + matrix: + target: + - Linux + state: + - Orchard + - NU7 + + include: + - target: Linux + os: ubuntu-latest-8cores + + - state: Orchard + extra_flags: orchard + - state: NU7 + rustflags: '--cfg zcash_unstable="nu7"' + + env: + RUSTFLAGS: ${{ matrix.rustflags }} + RUSTDOCFLAGS: ${{ matrix.rustflags }} + + steps: + - uses: actions/checkout@v4 + - id: prepare + uses: ./.github/actions/prepare + with: + extra-features: ${{ matrix.extra_flags || '' }} + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-msrv-${{ hashFiles('**/Cargo.lock') }} - name: Run slow tests run: > cargo test From 414374211764b1458ff1dec32513f02f2024748c Mon Sep 17 00:00:00 2001 From: Daira-Emma Hopwood Date: Mon, 9 Dec 2024 21:35:23 +0000 Subject: [PATCH 2/4] Include `extra_flags: orchard` in NU7 state. Signed-off-by: Daira-Emma Hopwood --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e54a436061..7b05f5f17a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,6 +36,7 @@ jobs: - state: Orchard extra_flags: orchard - state: NU7 + extra_flags: orchard rustflags: '--cfg zcash_unstable="nu7"' exclude: @@ -88,6 +89,7 @@ jobs: - state: Orchard extra_flags: orchard - state: NU7 + extra_flags: orchard rustflags: '--cfg zcash_unstable="nu7"' env: From 8b3393ae9f19f18239e5950403c86e55d653422e Mon Sep 17 00:00:00 2001 From: Daira-Emma Hopwood Date: Mon, 9 Dec 2024 22:29:46 +0000 Subject: [PATCH 3/4] Rename required checks task for audits, so that it can be distinguished from the status checks task. Signed-off-by: Daira-Emma Hopwood --- .github/workflows/audits.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/audits.yml b/.github/workflows/audits.yml index f6a3bbc738..a3f8d42143 100644 --- a/.github/workflows/audits.yml +++ b/.github/workflows/audits.yml @@ -29,8 +29,8 @@ jobs: with: command: check licenses - required-checks: - name: Required status checks have passed + required-audits: + name: Required audits have passed needs: - cargo-vet - cargo-deny From 28ce1896b63ce4b35c0e346113eabea75a1f3acf Mon Sep 17 00:00:00 2001 From: Daira-Emma Hopwood Date: Mon, 9 Dec 2024 22:52:49 +0000 Subject: [PATCH 4/4] Adjust CI policy: * Only require tests to pass on Linux. * Remove the confusing and unnecessary "NOT_A_PUZZLE" state. Signed-off-by: Daira-Emma Hopwood --- .github/workflows/ci.yml | 75 ++++++++++++++++++++++++++++++---------- 1 file changed, 57 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b05f5f17a..416f563f68 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,27 +7,70 @@ on: merge_group: jobs: - test: - name: > - Test${{ - matrix.state != 'NOT_A_PUZZLE' && format(' {0}', matrix.state) || '' - }} on ${{ matrix.target }} + required-test: + name: Test ${{ matrix.state }} on ${{ matrix.target }} runs-on: ${{ matrix.os }} - continue-on-error: ${{ matrix.state != 'NOT_A_PUZZLE' }} strategy: matrix: target: - Linux - - macOS - - Windows state: - - NOT_A_PUZZLE + - no-Orchard - Orchard - NU7 include: - target: Linux os: ubuntu-latest-8cores + + - state: Orchard + extra_flags: orchard + - state: NU7 + extra_flags: orchard + rustflags: '--cfg zcash_unstable="nu7"' + + env: + RUSTFLAGS: ${{ matrix.rustflags }} + RUSTDOCFLAGS: ${{ matrix.rustflags }} + + steps: + - uses: actions/checkout@v4 + - id: prepare + uses: ./.github/actions/prepare + with: + extra-features: ${{ matrix.extra_flags || '' }} + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-msrv-${{ hashFiles('**/Cargo.lock') }} + - name: Run tests + run: > + cargo test + --workspace + ${{ steps.prepare.outputs.feature-flags }} + - name: Verify working directory is clean + run: git diff --exit-code + + test: + name: Test ${{ matrix.state }} on ${{ matrix.target }} + runs-on: ${{ matrix.os }} + continue-on-error: true + strategy: + matrix: + target: + - macOS + - Windows + state: + - no-Orchard + - Orchard + - NU7 + + include: - target: macOS os: macOS-latest - target: Windows @@ -52,7 +95,7 @@ jobs: - id: prepare uses: ./.github/actions/prepare with: - extra-features: ${{ matrix.state != 'NOT_A_PUZZLE' && matrix.extra_flags || '' }} + extra-features: ${{ matrix.extra_flags || '' }} - uses: actions/cache@v4 with: path: | @@ -71,7 +114,7 @@ jobs: run: git diff --exit-code test-slow: - name: Slow Test + name: Slow Test ${{ matrix.state }} on ${{ matrix.target }} runs-on: ${{ matrix.os }} continue-on-error: true strategy: @@ -123,12 +166,8 @@ jobs: # States that we want to ensure can be built, but that we don't actively run tests for. check-msrv: - name: > - Check${{ - matrix.state != 'NOT_A_PUZZLE' && format(' {0}', matrix.state) || '' - }} build on ${{ matrix.target }} + name: Check ${{ matrix.state }} build on ${{ matrix.target }} runs-on: ${{ matrix.os }} - continue-on-error: ${{ matrix.state != 'NOT_A_PUZZLE' }} strategy: matrix: target: @@ -158,7 +197,7 @@ jobs: - id: prepare uses: ./.github/actions/prepare with: - extra-features: ${{ matrix.state != 'NOT_A_PUZZLE' && matrix.extra_flags || '' }} + extra-features: ${{ matrix.extra_flags || '' }} - uses: actions/cache@v4 with: path: | @@ -413,7 +452,7 @@ jobs: required-checks: name: Required status checks have passed needs: - - test + - required-test - check-msrv - build-latest - build-nodefault