diff --git a/.github/actions/bitcoin-int-tests/Dockerfile.bitcoin-tests b/.github/actions/bitcoin-int-tests/Dockerfile.bitcoin-tests index b3a7d97ff5..18e28e9683 100644 --- a/.github/actions/bitcoin-int-tests/Dockerfile.bitcoin-tests +++ b/.github/actions/bitcoin-int-tests/Dockerfile.bitcoin-tests @@ -3,5 +3,10 @@ FROM stacks-node:integrations ARG test_name ENV BITCOIND_TEST 1 -RUN cargo test -- --test-threads 1 --ignored "$test_name" +RUN cargo build && \ + cargo test -- --test-threads 1 --ignored "$test_name" +RUN grcov . --binary-path ../../target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info && \ + curl -Os https://uploader.codecov.io/latest/linux/codecov && \ + chmod +x codecov && \ + ./codecov diff --git a/.github/actions/bitcoin-int-tests/Dockerfile.code-cov b/.github/actions/bitcoin-int-tests/Dockerfile.code-cov index 3f82ab154a..924c94a680 100644 --- a/.github/actions/bitcoin-int-tests/Dockerfile.code-cov +++ b/.github/actions/bitcoin-int-tests/Dockerfile.code-cov @@ -16,4 +16,6 @@ RUN cargo build && \ # Generate coverage report and upload it to codecov RUN grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info && \ - bash -c "bash <(curl -s https://codecov.io/bash)" + curl -Os https://uploader.codecov.io/latest/linux/codecov && \ + chmod +x codecov && \ + ./codecov diff --git a/.github/actions/bitcoin-int-tests/Dockerfile.generic.bitcoin-tests b/.github/actions/bitcoin-int-tests/Dockerfile.generic.bitcoin-tests index 476dd3a2c5..0195b38fb9 100644 --- a/.github/actions/bitcoin-int-tests/Dockerfile.generic.bitcoin-tests +++ b/.github/actions/bitcoin-int-tests/Dockerfile.generic.bitcoin-tests @@ -5,7 +5,15 @@ WORKDIR /src/ COPY . . WORKDIR /src/testnet/stacks-node -RUN cargo test --no-run + +RUN rustup override set nightly && \ + rustup component add llvm-tools-preview && \ + cargo install grcov + +ENV RUSTFLAGS="-Zinstrument-coverage" \ + LLVM_PROFILE_FILE="stacks-blockchain-%p-%m.profraw" + +RUN cargo build RUN cd / && wget https://bitcoin.org/bin/bitcoin-core-0.20.0/bitcoin-0.20.0-x86_64-linux-gnu.tar.gz RUN cd / && tar -xvzf bitcoin-0.20.0-x86_64-linux-gnu.tar.gz diff --git a/.github/workflows/bitcoin-tests.yml b/.github/workflows/bitcoin-tests.yml index 1d37abe224..df06f2612f 100644 --- a/.github/workflows/bitcoin-tests.yml +++ b/.github/workflows/bitcoin-tests.yml @@ -13,7 +13,10 @@ jobs: - name: Build bitcoin integration testing image env: DOCKER_BUILDKIT: 1 - run: docker build -f ./.github/actions/bitcoin-int-tests/Dockerfile.generic.bitcoin-tests -t stacks-node:integrations . + # Remove .dockerignore file so codecov has access to git info + run: | + rm .dockerignore + docker build -f ./.github/actions/bitcoin-int-tests/Dockerfile.generic.bitcoin-tests -t stacks-node:integrations . - name: Export docker image as tarball run: docker save -o integration-image.tar stacks-node:integrations - name: Upload built docker image diff --git a/.github/workflows/stacks-blockchain.yml b/.github/workflows/stacks-blockchain.yml index 63c26dcc7b..2c25d6c9bb 100644 --- a/.github/workflows/stacks-blockchain.yml +++ b/.github/workflows/stacks-blockchain.yml @@ -49,7 +49,10 @@ jobs: - name: Run units tests (with coverage) env: DOCKER_BUILDKIT: 1 - run: docker build -f ./.github/actions/bitcoin-int-tests/Dockerfile.code-cov . + # Remove .dockerignore file so codecov has access to git info + run: | + rm .dockerignore + docker build -f ./.github/actions/bitcoin-int-tests/Dockerfile.code-cov . open-api-validation: runs-on: ubuntu-latest