Skip to content

Commit

Permalink
Merge pull request #30 from moka-rs/codecov
Browse files Browse the repository at this point in the history
CI: codecov.io - Measure the code coverage with `cargo-llvm-cov` and upload the report to codecov.io
  • Loading branch information
tatsuya6502 committed Jun 9, 2024
2 parents 794b84d + e70a195 commit 24feb19
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# https://docs.codecov.com/docs/quick-start#tips-and-tricks
# https://docs.codecov.com/docs/codecovyml-reference

coverage:
status:
project:
default:
informational: true
patch: false

comment:
layout: "diff"
require_changes: true
39 changes: 39 additions & 0 deletions .github/workflows/Codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Codecov

on:
pull_request:
paths-ignore:
- '.devcontainer/**'
- '.gitpod.yml'
- '.vscode/**'

jobs:
codecov:
runs-on: ubuntu-latest
steps:
- name: Checkout Mini Moka
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable

- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov

- run: cargo clean

- name: Show cargo tree
run: cargo tree

- name: Run tests (debug, sync feature)
run: cargo llvm-cov --features sync --lcov --output-path lcov.info

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
files: ./lcov.info
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit 24feb19

Please sign in to comment.