diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index ba56cde1f00..5f111fd5d24 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -21,6 +21,9 @@ env: RUST_LIB_BACKTRACE: 1 RUST_LOG: info COLORBT_SHOW_HIDDEN: 1 + # Mirror the cfgs in .cargo/config.toml: RUSTFLAGS/RUSTDOCFLAGS replace the + # config's rustflags rather than adding to them, compiling out NU7/ZSA code. + ZEBRA_CFGS: '--cfg zcash_unstable="nu7" --cfg feature="tx_v6"' jobs: changes: @@ -57,6 +60,7 @@ jobs: persist-credentials: false - uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 #v1.16.1 with: + rustflags: '-D warnings ${{ env.ZEBRA_CFGS }}' toolchain: stable components: llvm-tools-preview cache-on-failure: true diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index cc32f60cb08..a3d3709f371 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,6 +22,9 @@ permissions: env: CLICOLOR: 1 + # Mirror the cfgs in .cargo/config.toml: RUSTFLAGS/RUSTDOCFLAGS replace the + # config's rustflags rather than adding to them, compiling out NU7/ZSA code. + ZEBRA_CFGS: '--cfg zcash_unstable="nu7" --cfg feature="tx_v6"' jobs: changes: @@ -70,6 +73,7 @@ jobs: persist-credentials: false - uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 #v1.16.1 with: + rustflags: '-D warnings ${{ env.ZEBRA_CFGS }}' components: clippy toolchain: ${{ matrix.rust-version }} cache-on-failure: true @@ -91,6 +95,7 @@ jobs: persist-credentials: false - uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 #v1.16.1 with: + rustflags: '-D warnings ${{ env.ZEBRA_CFGS }}' cache-on-failure: true - uses: taiki-e/install-action@65851e10cd6c377f11a60e600abc07cb08643468 #v2.79.3 with: @@ -99,7 +104,7 @@ jobs: - run: cargo hack check --workspace msrv: - name: MSRV + name: MSRV (nu7=${{ matrix.nu7 }}) needs: changes if: needs.changes.outputs.lint == 'true' permissions: @@ -109,7 +114,13 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 strategy: + # Both legs run to completion: they check different code, and the two + # configurations fail independently. + fail-fast: false matrix: + nu7: + - true + - false include: - binary: zebrad steps: @@ -118,7 +129,11 @@ jobs: persist-credentials: false - uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 #v1.16.1 with: + # The nu7=false leg is the only job that still checks the MSRV build + # without the ZSA code paths, which is what upstream compiles. + rustflags: ${{ matrix.nu7 && format('-D warnings {0}', env.ZEBRA_CFGS) || '-D warnings' }} toolchain: 1.91 # MSRV + cache-key: msrv-nu7-${{ matrix.nu7 }} cache-on-failure: true - uses: ./.github/actions/setup-zebra-build - run: cargo build --bin "${{ matrix.binary }}" --workspace @@ -138,6 +153,7 @@ jobs: persist-credentials: false - uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 #v1.16.1 with: + rustflags: '-D warnings ${{ env.ZEBRA_CFGS }}' toolchain: nightly cache-on-failure: true - uses: ./.github/actions/setup-zebra-build @@ -146,7 +162,7 @@ jobs: # Keep in sync with ./book.yml:jobs.build # The -A and -W settings must be the same as the `rustdocflags` in: # https://github.com/ZcashFoundation/zebra/blob/main/.cargo/config.toml#L87 - RUSTDOCFLAGS: --html-in-header katex-header.html -A rustdoc::private_intra_doc_links -D warnings + RUSTDOCFLAGS: --html-in-header katex-header.html -A rustdoc::private_intra_doc_links -D warnings ${{ env.ZEBRA_CFGS }} fmt: name: fmt @@ -184,6 +200,7 @@ jobs: persist-credentials: false - uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 #v1.16.1 with: + rustflags: '-D warnings ${{ env.ZEBRA_CFGS }}' # TODO: QED-it temp nightly pin: matches Zebra v4.2.0 CI test period; remove before upstream merge. toolchain: nightly-2026-03-06 cache-on-failure: true @@ -237,7 +254,7 @@ jobs: - uses: ./.github/actions/setup-zebra-build - run: cargo hack check --all env: - RUSTFLAGS: -D warnings + RUSTFLAGS: -D warnings ${{ env.ZEBRA_CFGS }} check-cargo-lock: name: check-cargo-lock @@ -254,6 +271,7 @@ jobs: persist-credentials: false - uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 #v1.16.1 with: + rustflags: '-D warnings ${{ env.ZEBRA_CFGS }}' toolchain: stable cache-on-failure: true - uses: ./.github/actions/setup-zebra-build diff --git a/.github/workflows/test-crates.yml b/.github/workflows/test-crates.yml index c6e829991b1..5fc81d55605 100644 --- a/.github/workflows/test-crates.yml +++ b/.github/workflows/test-crates.yml @@ -27,6 +27,9 @@ env: RUST_LIB_BACKTRACE: 1 RUST_LOG: info COLORBT_SHOW_HIDDEN: 1 + # Mirror the cfgs in .cargo/config.toml: RUSTFLAGS/RUSTDOCFLAGS replace the + # config's rustflags rather than adding to them, compiling out NU7/ZSA code. + ZEBRA_CFGS: '--cfg zcash_unstable="nu7" --cfg feature="tx_v6"' jobs: changes: @@ -118,6 +121,7 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 #v1.16.1 with: + rustflags: '-D warnings ${{ env.ZEBRA_CFGS }}' # TODO: QED-it temp Rust 1.94 pin: stable for Zebra v4.2.0 CI; remove before upstream merge. toolchain: "1.94" components: clippy @@ -182,6 +186,7 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 #v1.16.1 with: + rustflags: '-D warnings ${{ env.ZEBRA_CFGS }}' toolchain: ${{ steps.msrv.outputs.version }} components: clippy cache-key: crate-build-msrv-${{ matrix.crate }}