Skip to content

Commit

Permalink
ci: add codecov coverage report (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
aborgna-q authored Oct 31, 2023
1 parent 33e8cf2 commit 906c4e2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
28 changes: 27 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- main
merge_group:
types: [checks_requested]
workflow_dispatch: {}

env:
CARGO_TERM_COLOR: always
Expand Down Expand Up @@ -103,4 +104,29 @@ jobs:
- name: Build with all features
run: cargo test --verbose --all-features --no-run
- name: Tests with all features
run: cargo test --verbose --all-features
run: cargo test --verbose --all-features

coverage:
if: github.event_name != 'merge_group'
needs: [tests, check]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: mozilla-actions/[email protected]
- uses: dtolnay/rust-toolchain@nightly
with:
components: llvm-tools-preview
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run tests with coverage instrumentation
run: |
cargo llvm-cov clean --workspace
cargo llvm-cov --doctests
- name: Generate coverage report
run: cargo llvm-cov report --codecov --output-path coverage.json
- name: Upload coverage to codecov.io
uses: codecov/codecov-action@v3
with:
files: coverage.json
name: ubuntu
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ portgraph
[![build_status][]](https://github.com/CQCL/portgraph/actions)
[![crates][]](https://crates.io/crates/portgraph)
[![msrv][]](https://github.com/CQCL/portgraph)
[![codecov][]](https://codecov.io/gh/CQCL/portgraph)

Data structure library for directed graphs with first-level ports. Includes
secondary data structures for node and port weights, and node hierarchies.
Expand Down Expand Up @@ -35,4 +36,5 @@ This project is licensed under Apache License, Version 2.0 ([LICENSE][] or http:
[crates]: https://img.shields.io/crates/v/portgraph
[LICENSE]: LICENCE
[msrv]: https://img.shields.io/badge/rust-1.70.0%2B-blue.svg?maxAge=3600
[codecov]: https://img.shields.io/codecov/c/gh/CQCL/portgraph?logo=codecov
[CHANGELOG]: CHANGELOG.md

0 comments on commit 906c4e2

Please sign in to comment.