From c3d9855df0d5ff001a7bfc962458cfb38a6f2a10 Mon Sep 17 00:00:00 2001 From: Michael-J-Ward Date: Wed, 21 Aug 2024 14:19:59 -0500 Subject: [PATCH 1/6] update badge URLs and CI token --- .github/workflows/CI.yml | 5 ++++- README.md | 7 +++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 6d4dfe9..41b7cf6 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -45,7 +45,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 From b88e88aff514645b242455220b8617158d0110c4 Mon Sep 17 00:00:00 2001 From: Michael-J-Ward Date: Wed, 21 Aug 2024 14:54:35 -0500 Subject: [PATCH 2/6] update to GH workflow to use actions/checkout@v4 --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 41b7cf6..7607682 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -12,7 +12,7 @@ jobs: os: ["ubuntu"] runs-on: ${{ matrix.os }}-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions/setup-python@v2 with: python-version: "3.10" From d32fdd5bb6086ae3dc8c549d68b211178506f171 Mon Sep 17 00:00:00 2001 From: Michael-J-Ward Date: Wed, 21 Aug 2024 14:56:52 -0500 Subject: [PATCH 3/6] update CI workflow to use actions/setup-python@v5 --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 7607682..56c2053 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -13,7 +13,7 @@ jobs: runs-on: ${{ matrix.os }}-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v5 with: python-version: "3.10" cache: "pip" From 8446f81e93fe1b067470a0b62ac8f269d4fde620 Mon Sep 17 00:00:00 2001 From: Michael-J-Ward Date: Wed, 21 Aug 2024 14:59:56 -0500 Subject: [PATCH 4/6] replace archived rust setup with direct rustup invocation --- .github/workflows/CI.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 56c2053..c36306e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -17,12 +17,8 @@ jobs: 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 From 364a96af61d6ba43850fa4fc2ba54ac1bc44cfcb Mon Sep 17 00:00:00 2001 From: Michael-J-Ward Date: Wed, 21 Aug 2024 15:04:56 -0500 Subject: [PATCH 5/6] update rust-cache action --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c36306e..4df42ef 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -21,7 +21,7 @@ jobs: 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 From 9a6aa33ed66b196e18e1bea3de4addebac0fd9ef Mon Sep 17 00:00:00 2001 From: Michael-J-Ward Date: Wed, 21 Aug 2024 15:19:21 -0500 Subject: [PATCH 6/6] cargo fmt --- src/lib.rs | 1 - 1 file changed, 1 deletion(-) 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)