Skip to content

Commit

Permalink
feat(ci): Add codecov (#233)
Browse files Browse the repository at this point in the history
Adds codecov to CI
  • Loading branch information
clabby authored Jun 11, 2024
1 parent 93ee899 commit 4a40f54
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# ref: https://docs.codecov.com/docs/codecovyml-reference
coverage:
# TODO: Raise coverage requirements
range: 25..100
round: down
precision: 1
status:
# ref: https://docs.codecov.com/docs/commit-status
project:
default:
# Avoid false negatives
threshold: 1%

ignore:
- "tests"
- "test_util*"
- "test_utils"
- "bin/programs/minimal"
- "bin/programs/simple-revm"

# Make comments less noisy
comment:
layout: "condensed_header, condensed_files, condensed_footer"
require_changes: true
hide_project_coverage: false
33 changes: 33 additions & 0 deletions .github/workflows/rust_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,36 @@ jobs:
run: just lint-docs
- name: doctest
run: just test-docs
coverage:
runs-on: ubuntu-latest
name: codecov
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install stable
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: cargo install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: cargo install cargo-nextest
uses: taiki-e/install-action@nextest
- name: cargo generate-lockfile
if: hashFiles('Cargo.lock') == ''
run: cargo generate-lockfile
- name: cargo llvm-cov
run: cargo llvm-cov nextest --locked --workspace --lcov --output-path lcov.info
- name: Record Rust version
run: echo "RUST=$(rustc --version)" >> "$GITHUB_ENV"
- name: Upload to codecov.io
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS,RUST
files: lcov.info

0 comments on commit 4a40f54

Please sign in to comment.