Skip to content

Commit

Permalink
ci: add code coverage (#158)
Browse files Browse the repository at this point in the history
* ci: add code coverage

* chore: add codecov.yml
  • Loading branch information
evilrobot-01 authored May 12, 2024
1 parent 45ad437 commit 0ac5411
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
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

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

0 comments on commit 0ac5411

Please sign in to comment.