diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 6d4dfe9..4df42ef 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -12,20 +12,16 @@ jobs: os: ["ubuntu"] runs-on: ${{ matrix.os }}-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: "3.10" cache: "pip" - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - profile: minimal - components: llvm-tools-preview + - name: Rust setup + run: rustup toolchain install stable --profile minimal - name: Install cargo-llvm-cov uses: taiki-e/install-action@cargo-llvm-cov - - uses: Swatinem/rust-cache@v1 + - uses: Swatinem/rust-cache@v2 with: key: coverage-cargo-${{ matrix.os }} continue-on-error: true @@ -45,7 +41,10 @@ jobs: maturin develop pytest tests --cov=foobar --cov-report lcov:python-coverage.lcov cargo llvm-cov report --lcov --output-path rust-coverage.lcov - - uses: codecov/codecov-action@v3 + - name: Upload results to Codecov + uses: codecov/codecov-action@v4 with: files: python-coverage.lcov,rust-coverage.lcov name: ${{ matrix.os }} + token: ${{ secrets.CODECOV_TOKEN }} + diff --git a/README.md b/README.md index 563c6d2..9b77985 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,8 @@ # rust-python-coverage Example PyO3 project with automated test coverage for Rust and Python -[![CI](https://github.com/cjermain/rust-python-coverage/actions/workflows/CI.yml/badge.svg)](https://github.com/cjermain/rust-python-coverage/actions/workflows/CI.yml) -[![codecov](https://codecov.io/gh/cjermain/rust-python-coverage/branch/main/graph/badge.svg?token=NWHDJ22L8I)](https://codecov.io/gh/cjermain/rust-python-coverage) +[![CI](https://github.com/Michael-J-Ward/rust-python-coverage/actions/workflows/CI.yml/badge.svg)](https://github.com/Michael-J-Ward/rust-python-coverage/actions/workflows/CI.yml) +[![codecov](https://codecov.io/github/Michael-J-Ward/rust-python-coverage/graph/badge.svg?token=K4T59SGTQX)](https://codecov.io/github/Michael-J-Ward/rust-python-coverage) This repository shows how to set up a continuous-integration job for measuring coverage over a project using [PyO3](https://github.com/PyO3/pyo3). Based on @@ -129,8 +129,7 @@ The last step of this process happens in the CI, where we upload both coverage files to CodeCov. [Merging reports](https://docs.codecov.com/docs/merging-reports) is an automatic feature of CodeCov, so the final view shows the combined view. -https://codecov.io/gh/cjermain/rust-python-coverage - +https://codecov.io/github/Michael-J-Ward/rust-python-coverage ## Appendix diff --git a/src/lib.rs b/src/lib.rs index 728b780..0fc793d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,3 @@ - use pyo3::prelude::*; /// Returns the sum of two numbers (only Rust)