Skip to content

Commit

Permalink
ci: add codecov coverage report
Browse files Browse the repository at this point in the history
  • Loading branch information
aborgna-q committed Oct 30, 2023
1 parent 33e8cf2 commit 0c46cdd
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions .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
34 changes: 34 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Coverage check

on:
push:
branches:
- main
workflow_dispatch: {}

jobs:
coverage:
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [ubuntu]
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: ${{ matrix.os }}
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 0c46cdd

Please sign in to comment.