From b9e101fbd8dd991c9745e9391077575f682f9a2e Mon Sep 17 00:00:00 2001 From: ascjones Date: Tue, 20 Sep 2022 12:00:26 +0100 Subject: [PATCH] Fix conflicts --- .gitlab-ci.yml | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 284367cc5a0..f0e997f966b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -290,6 +290,53 @@ docs: - chown -R nonroot:nonroot ./crate-docs +codecov: + stage: workspace + <<: *docker-env + <<: *test-refs + needs: + - job: check-std + artifacts: false + variables: + # For codecov it's sufficient to run the fuzz tests only once. + QUICKCHECK_TESTS: 1 + INK_COVERAGE_REPORTING: "true" + CARGO_INCREMENTAL: 0 + # Needed because `codecov` requires nightly features to work + # (see `-Z` in the `RUSTFLAGS` below). + RUSTC_BOOTSTRAP: "1" + # Variables partly came from https://github.com/mozilla/grcov/blob/master/README.md + RUSTFLAGS: "-Zprofile -Zmir-opt-level=0 -Ccodegen-units=1 + -Clink-dead-code -Copt-level=0 -Coverflow-checks=off" + # The `cargo-taurpalin` coverage reporting tool seems to have better code instrumentation and thus + # produces better results for Rust codebases in general. However, unlike `grcov` it requires + # running docker with `--security-opt seccomp=unconfined` which is why we use `grcov` instead. + before_script: + - *rust-info-script + # RUSTFLAGS are the cause target cache can't be used here + # FIXME: cust-covfix doesn't support the external target dir + # https://github.com/Kogia-sima/rust-covfix/issues/7 + - unset "CARGO_TARGET_DIR" + - cargo clean + # make sure there's no stale coverage artifacts + - find . -name "*.profraw" -type f -delete + - find . -name "*.gcda" -type f -delete + script: + # RUSTFLAGS are the cause target cache can't be used here + - cargo build --verbose --all-features --workspace + - cargo test --verbose --all-features --no-fail-fast --workspace + # coverage with branches + - grcov . --binary-path ./target/debug/ --source-dir . --output-type lcov --llvm --branch + --ignore-not-existing --ignore "/*" --ignore "tests/*" --output-path lcov-w-branch.info + - rust-covfix lcov-w-branch.info --output lcov-w-branch-fixed.info + - codecov --token "$CODECOV_P_TOKEN" --file lcov-w-branch-fixed.info --nonZero + # lines coverage + - grcov . --binary-path ./target/debug/ --source-dir . --output-type lcov --llvm + --ignore-not-existing --ignore "/*" --ignore "tests/*" --output-path lcov-lines.info + - rust-covfix lcov-lines.info --output lcov-lines-fixed.info + - codecov --token "$CODECOV_TOKEN" --file lcov-lines-fixed.info --nonZero + + #### stage: examples examples-test: