diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 940b6ac..a7851b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,7 @@ on: - main merge_group: types: [checks_requested] + workflow_dispatch: {} env: CARGO_TERM_COLOR: always diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..cf19d31 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -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/sccache-action@v0.0.3 + - 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 }} diff --git a/README.md b/README.md index 8ae909d..d5a3750 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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 \ No newline at end of file