This repository has been archived by the owner on Oct 13, 2024. It is now read-only.
chore(deps): update codecov/codecov-action action to v4 #261
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
toolchain: | |
- stable | |
- beta | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup tooling | |
run: | | |
rustup update ${{ matrix.toolchain }} | |
rustup default ${{ matrix.toolchain }} | |
rustup component add clippy | |
rustup component add rustfmt | |
rustup component add llvm-tools-preview | |
- name: Toolchain info | |
run: | | |
cargo --version --verbose | |
rustc --version | |
cargo clippy --version | |
- name: Using cache | |
uses: Swatinem/[email protected] | |
with: | |
cache-all-crates: "true" | |
cache-on-failure: "true" | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Check package | |
run: cargo check | |
- name: Check formatting | |
run: cargo fmt -- --check | |
- name: Lint | |
run: cargo clippy -- -D warnings -A dead_code | |
- name: Test | |
env: | |
TEST_ONLY: cargo test | |
TEST_COVERAGE: | | |
cargo llvm-cov test \ | |
--all-features \ | |
--workspace \ | |
--codecov \ | |
--output-path codecov.json \ | |
--ignore-filename-regex '_tests\.rs' | |
run: ${{ matrix.toolchain == 'stable' && env.TEST_COVERAGE || env.TEST_ONLY }} | |
- name: Upload coverage to Codecov | |
if: matrix.toolchain == 'stable' | |
uses: codecov/[email protected] | |
with: | |
files: codecov.json | |
token: ${{ secrets.CODECOV_TOKEN }} |