From 2bd813ad98e07602fd66efe18933ed6ddbd567b9 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Sat, 4 Jul 2026 08:10:37 +0900 Subject: [PATCH] chore: migrate to GitHub-builtin coverage --- .github/workflows/actions.lock | 21 +++++++-------------- .github/workflows/coverage.yml | 18 +++++++++++------- actix-web/README.md | 2 +- justfile | 6 +++--- 4 files changed, 22 insertions(+), 25 deletions(-) diff --git a/.github/workflows/actions.lock b/.github/workflows/actions.lock index 7fb6a3632..e21e18132 100644 --- a/.github/workflows/actions.lock +++ b/.github/workflows/actions.lock @@ -21,7 +21,7 @@ workflows: '.github/workflows/coverage.yml': - 'actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659' - 'actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0' - - 'codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f' + - 'actions/upload-code-coverage@a72ab75b4dee0e479386fb9bf33c8dcf64b9c772' - 'taiki-e/install-action@4684b8405694ae9dd42c9f39ba901a70ae83f4a3' '.github/workflows/labeler.yml': - 'actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0' @@ -55,23 +55,16 @@ dependencies: commit: 'sha1-9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0' owner_id: 44036562 repo_id: 197814629 - 'actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd': - ref: 'v8.0.0' - commit: 'sha1-ed597411d8f924073f98dfc5c65a23a2325f34cd' - owner_id: 44036562 - repo_id: 205262760 'actions/labeler@b8dd2d9be0f68b860e7dae5dae7d772984eacd6d': ref: 'v6.2.0' commit: 'sha1-b8dd2d9be0f68b860e7dae5dae7d772984eacd6d' owner_id: 44036562 repo_id: 177139928 - 'codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f': - ref: 'fb8b3582c8e4def4969c97caa2f19720cb33a72f' - commit: 'sha1-fb8b3582c8e4def4969c97caa2f19720cb33a72f' - owner_id: 8226205 - repo_id: 200299178 - uses: - - 'actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd' + 'actions/upload-code-coverage@a72ab75b4dee0e479386fb9bf33c8dcf64b9c772': + ref: 'v1.4.0' + commit: 'sha1-a72ab75b4dee0e479386fb9bf33c8dcf64b9c772' + owner_id: 44036562 + repo_id: 1220171870 'embarkstudios/cargo-deny-action@bb137d7af7e4fb67e5f82a49c4fce4fad40782fe': ref: 'bb137d7af7e4fb67e5f82a49c4fce4fad40782fe' commit: 'sha1-bb137d7af7e4fb67e5f82a49c4fce4fad40782fe' @@ -110,7 +103,7 @@ dependencies: uses: - 'actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae' 'taiki-e/install-action@4684b8405694ae9dd42c9f39ba901a70ae83f4a3': - ref: 'v2.82.9' + ref: '4684b8405694ae9dd42c9f39ba901a70ae83f4a3' commit: 'sha1-4684b8405694ae9dd42c9f39ba901a70ae83f4a3' owner_id: 43724913 repo_id: 442947557 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 128443f7b..0dc6f10ec 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -5,9 +5,13 @@ name: Coverage on: push: branches: [main] + pull_request: + branches: [main] permissions: contents: read + code-quality: write + pull-requests: read concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -33,12 +37,12 @@ jobs: tool: just,cargo-llvm-cov,cargo-nextest - name: Generate code coverage - run: just test-coverage-codecov + run: just test-coverage-cobertura - - name: Upload coverage to Codecov - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 + - name: Upload coverage to GitHub + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository + uses: actions/upload-code-coverage@a72ab75b4dee0e479386fb9bf33c8dcf64b9c772 # v1.4.0 with: - files: codecov.json - fail_ci_if_error: true - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + file: cobertura.xml + language: Rust + label: code-coverage/cargo-llvm-cov diff --git a/actix-web/README.md b/actix-web/README.md index a83f246a3..b71c57336 100644 --- a/actix-web/README.md +++ b/actix-web/README.md @@ -14,7 +14,7 @@ [![Dependency Status](https://deps.rs/crate/actix-web/4.14.0/status.svg)](https://deps.rs/crate/actix-web/4.14.0)
[![CI](https://github.com/actix/actix-web/actions/workflows/ci.yml/badge.svg)](https://github.com/actix/actix-web/actions/workflows/ci.yml) -[![codecov](https://codecov.io/gh/actix/actix-web/graph/badge.svg?token=dSwOnp9QCv)](https://codecov.io/gh/actix/actix-web) +[![Coverage](https://github.com/actix/actix-web/actions/workflows/coverage.yml/badge.svg)](https://github.com/actix/actix-web/actions/workflows/coverage.yml) ![downloads](https://img.shields.io/crates/d/actix-web.svg) [![Chat on Discord](https://img.shields.io/discord/771444961383153695?label=chat&logo=discord)](https://discord.gg/NWpN5mmg3x) diff --git a/justfile b/justfile index ba8014f43..4c65e4df9 100644 --- a/justfile +++ b/justfile @@ -73,9 +73,9 @@ test-coverage: cargo {{ toolchain }} llvm-cov nextest --no-tests=warn --no-report {{ all_crate_features }} cargo {{ toolchain }} llvm-cov --doc --no-report {{ all_crate_features }} -# Test workspace and generate Codecov report. -test-coverage-codecov: test-coverage - cargo {{ toolchain }} llvm-cov report --doctests --codecov --output-path=codecov.json +# Test workspace and generate Cobertura report. +test-coverage-cobertura: test-coverage + cargo {{ toolchain }} llvm-cov report --doctests --cobertura --output-path=cobertura.xml # Test workspace and generate LCOV report. test-coverage-lcov: test-coverage