Skip to content

Commit

Permalink
feat(ci): Codecov self-hosted test (#562)
Browse files Browse the repository at this point in the history
* Codecov self-hosted test

* chore(ci): Enable Codecov Test Analytics feature for detecting flaky tests (#563)

https://docs.codecov.com/docs/test-analytics

* Update Codecov badges on README

---------

Co-authored-by: Romain Ruetschi <[email protected]>
  • Loading branch information
greg-szabo and romac authored Nov 18, 2024
1 parent e1c8ab2 commit 0db7d83
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,41 @@ jobs:
with:
toolchain: nightly
components: llvm-tools-preview
- name: Install cargo-nextest
uses: taiki-e/install-action@cargo-nextest
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: |
cargo llvm-cov test \
cargo llvm-cov nextest \
--workspace \
--exclude malachite-test-mbt \
--ignore-filename-regex crates/cli \
--all-features \
--jobs 1 \
--no-capture \
--ignore-run-fail \
--lcov \
--output-path lcov.info
- name: Generate text report
run: cargo llvm-cov report
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
if: ${{ !cancelled() }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: code/lcov.info
flags: integration
fail_ci_if_error: false
url: https://codecov.informal.systems
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: code/target/nextest/default/junit.xml
flags: integration
fail_ci_if_error: false
url: https://codecov.informal.systems

mbt:
name: MBT
Expand Down Expand Up @@ -101,9 +114,10 @@ jobs:
- name: Generate text report
run: cargo llvm-cov report
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: code/lcov.info
flags: mbt
fail_ci_if_error: false
url: https://codecov.informal.systems
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ Unless required by applicable law or agreed to in writing, software distributed
[quint-link]: https://github.com/informalsystems/malachite/actions/workflows/quint.yml
[mbt-test-image]: https://github.com/informalsystems/malachite/actions/workflows/mbt.yml/badge.svg
[mbt-test-link]: https://github.com/informalsystems/malachite/actions/workflows/mbt.yml
[coverage-image]: https://codecov.io/gh/informalsystems/malachite/graph/badge.svg?token=B9KY7B6DJF
[coverage-link]: https://codecov.io/gh/informalsystems/malachite
[coverage-image]: https://codecov.informal.systems/gh/informalsystems/malachite/graph/badge.svg?token=LO0NSEJ9FC
[coverage-link]: https://codecov.informal.systems/gh/informalsystems/malachite
[license-image]: https://img.shields.io/badge/license-Apache_2.0-blue.svg
[license-link]: https://github.com/informalsystems/hermes/blob/master/LICENSE
[rustc-image]: https://img.shields.io/badge/Rust-stable-orange.svg
Expand Down
6 changes: 6 additions & 0 deletions code/.config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[profile.default]
retries = 1
fail-fast = false

[profile.default.junit]
path = "junit.xml"

0 comments on commit 0db7d83

Please sign in to comment.