chore: migrate to GitHub-builtin coverage

This commit is contained in:
Yuki Okushi 2026-07-04 08:10:37 +09:00
parent 1fc14e3072
commit 1cc0e4d532
4 changed files with 21 additions and 24 deletions

View File

@ -21,7 +21,7 @@ workflows:
'.github/workflows/coverage.yml': '.github/workflows/coverage.yml':
- 'actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6' - 'actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6'
- 'actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0' - 'actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0'
- 'codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f' - 'actions/upload-code-coverage@82c7aee3fb2ad768e00b00a0a8d749c5815085b6'
- 'taiki-e/install-action@9e1e5806d4a4822de933115878265be9aaa786d9' - 'taiki-e/install-action@9e1e5806d4a4822de933115878265be9aaa786d9'
'.github/workflows/labeler.yml': '.github/workflows/labeler.yml':
- 'actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0' - 'actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0'
@ -55,23 +55,16 @@ dependencies:
commit: 'sha1-9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0' commit: 'sha1-9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0'
owner_id: 44036562 owner_id: 44036562
repo_id: 197814629 repo_id: 197814629
'actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd':
ref: 'v8.0.0'
commit: 'sha1-ed597411d8f924073f98dfc5c65a23a2325f34cd'
owner_id: 44036562
repo_id: 205262760
'actions/labeler@f27b608878404679385c85cfa523b85ccb86e213': 'actions/labeler@f27b608878404679385c85cfa523b85ccb86e213':
ref: 'v6.1.0' ref: 'v6.1.0'
commit: 'sha1-f27b608878404679385c85cfa523b85ccb86e213' commit: 'sha1-f27b608878404679385c85cfa523b85ccb86e213'
owner_id: 44036562 owner_id: 44036562
repo_id: 177139928 repo_id: 177139928
'codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f': 'actions/upload-code-coverage@82c7aee3fb2ad768e00b00a0a8d749c5815085b6':
ref: 'v7.0.0' ref: 'v1.3.0'
commit: 'sha1-fb8b3582c8e4def4969c97caa2f19720cb33a72f' commit: 'sha1-82c7aee3fb2ad768e00b00a0a8d749c5815085b6'
owner_id: 8226205 owner_id: 44036562
repo_id: 200299178 repo_id: 1220171870
uses:
- 'actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd'
'embarkstudios/cargo-deny-action@bb137d7af7e4fb67e5f82a49c4fce4fad40782fe': 'embarkstudios/cargo-deny-action@bb137d7af7e4fb67e5f82a49c4fce4fad40782fe':
ref: 'v2.0.20' ref: 'v2.0.20'
commit: 'sha1-bb137d7af7e4fb67e5f82a49c4fce4fad40782fe' commit: 'sha1-bb137d7af7e4fb67e5f82a49c4fce4fad40782fe'

View File

@ -5,9 +5,13 @@ name: Coverage
on: on:
push: push:
branches: [main] branches: [main]
pull_request:
branches: [main]
permissions: permissions:
contents: read contents: read
code-quality: write
pull-requests: read
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
@ -33,12 +37,12 @@ jobs:
tool: just,cargo-llvm-cov,cargo-nextest tool: just,cargo-llvm-cov,cargo-nextest
- name: Generate code coverage - name: Generate code coverage
run: just test-coverage-codecov run: just test-coverage-cobertura
- name: Upload coverage to Codecov - name: Upload coverage to GitHub
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
uses: actions/upload-code-coverage@82c7aee3fb2ad768e00b00a0a8d749c5815085b6 # v1.3.0
with: with:
files: codecov.json file: cobertura.xml
fail_ci_if_error: true language: Rust
env: label: code-coverage/cargo-llvm-cov
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

View File

@ -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) [![Dependency Status](https://deps.rs/crate/actix-web/4.14.0/status.svg)](https://deps.rs/crate/actix-web/4.14.0)
<br /> <br />
[![CI](https://github.com/actix/actix-web/actions/workflows/ci.yml/badge.svg)](https://github.com/actix/actix-web/actions/workflows/ci.yml) [![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) ![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) [![Chat on Discord](https://img.shields.io/discord/771444961383153695?label=chat&logo=discord)](https://discord.gg/NWpN5mmg3x)

View File

@ -73,9 +73,9 @@ test-coverage:
cargo {{ toolchain }} llvm-cov nextest --no-tests=warn --no-report {{ all_crate_features }} cargo {{ toolchain }} llvm-cov nextest --no-tests=warn --no-report {{ all_crate_features }}
cargo {{ toolchain }} llvm-cov --doc --no-report {{ all_crate_features }} cargo {{ toolchain }} llvm-cov --doc --no-report {{ all_crate_features }}
# Test workspace and generate Codecov report. # Test workspace and generate Cobertura report.
test-coverage-codecov: test-coverage test-coverage-cobertura: test-coverage
cargo {{ toolchain }} llvm-cov report --doctests --codecov --output-path=codecov.json cargo {{ toolchain }} llvm-cov report --doctests --cobertura --output-path=cobertura.xml
# Test workspace and generate LCOV report. # Test workspace and generate LCOV report.
test-coverage-lcov: test-coverage test-coverage-lcov: test-coverage