Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add code coverage #158

Merged
merged 2 commits into from
May 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions .github/workflows/build.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build & Test Pop-CLI
name: ci
AlexD10S marked this conversation as resolved.
Show resolved Hide resolved

on:
push:
Expand Down Expand Up @@ -49,8 +49,31 @@ jobs:
git-user: ${{ env.GITHUB_ACTOR }}

- name: Run unit tests
run: cargo test --lib
run: cargo test --lib --bins

coverage:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: "./.github/actions/init"
with:
git-user: ${{ env.GITHUB_ACTOR }}

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

- name: Generate code coverage
run: cargo llvm-cov --all-features --workspace --lib --bins --codecov --output-path codecov.json

- name: Upload to codecov.io
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: codecov.json
fail_ci_if_error: true

contract-integration-tests:
needs: lint
runs-on: ubuntu-latest
Expand Down
14 changes: 14 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# https://docs.codecov.com/docs/common-recipe-list
coverage:
status:
project:
default:
target: auto
threshold: 0%
comment:
layout: " diff, flags, files"
behavior: default
require_changes: false
require_base: false
require_head: true
hide_project_coverage: false