Skip to content

Commit

Permalink
Ci/fix codecov (#2932)
Browse files Browse the repository at this point in the history
* ci: update codecov upload method

* ci: give codecov git info

* ci: codecov for stacks-node tests

* ci: give codecov git access

* ci: build binary and fix path
  • Loading branch information
CharlieC3 authored Nov 17, 2021
1 parent 5d021a9 commit 8ceb0c0
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
7 changes: 6 additions & 1 deletion .github/actions/bitcoin-int-tests/Dockerfile.bitcoin-tests
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion .github/actions/bitcoin-int-tests/Dockerfile.code-cov
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/bitcoin-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/stacks-blockchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8ceb0c0

Please sign in to comment.