diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 5136802eaf1..7b8a7be130b 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -113,29 +113,26 @@ jobs: - uses: actions-rs/toolchain@v1 with: - toolchain: stable - profile: minimal + toolchain: nightly + components: clippy, llvm-tools-preview, rustfmt - - uses: Swatinem/rust-cache@v1 - - - name: Compile tests - run: cargo test --no-run --locked - - - name: Run tests - run: cargo test --all-features + - name: Install cargo-llvm-cov + run: | + curl -LsSf https://github.com/taiki-e/cargo-llvm-cov/releases/latest/download/cargo-llvm-cov-x86_64-unknown-linux-gnu.tar.gz | \ + tar xzf - -C ~/.cargo/bin - # Code coverage. Was removed due to #1221 + - uses: Swatinem/rust-cache@v1 - # - name: Generate code coverage - # run: | - # cargo +nightly llvm-cov clean --workspace - # cargo +nightly llvm-cov --test failpoints --no-report --features fail/failpoints - # cargo +nightly llvm-cov --no-report --all-features - # cargo +nightly llvm-cov --no-run --lcov --output-path lcov.info + - name: Generate code coverage + run: | + cargo +nightly llvm-cov clean --workspace + cargo +nightly llvm-cov --test failpoints --no-report --features fail/failpoints + cargo +nightly llvm-cov --no-report --all-features + cargo +nightly llvm-cov --no-run --lcov --output-path lcov.info - # - name: Upload coverage to Codecov - # uses: codecov/codecov-action@v2.1.0 - # with: - # token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos - # files: lcov.info - # fail_ci_if_error: true + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2.1.0 + with: + token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos + files: lcov.info + fail_ci_if_error: true