Skip to content

build: add codecov token #134

build: add codecov token

build: add codecov token #134

Workflow file for this run

name: checks
on: [push, pull_request]
jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: beta
override: true
- uses: Swatinem/rust-cache@v2
- uses: actions-rs/cargo@v1
with:
command: test
args: --all-features
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: beta
override: true
- uses: Swatinem/rust-cache@v2
- uses: actions-rs/cargo@v1
with:
command: check
args: --all-features
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: beta
override: true
components: rustfmt
- uses: Swatinem/rust-cache@v2
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: beta
override: true
components: clippy
- uses: Swatinem/rust-cache@v2
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-features -- -D warnings
coverage:
name: Coverage
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: beta
override: true
components: llvm-tools-preview
- uses: Swatinem/rust-cache@v2
- name: Install cargo-llvm-cov
run: |
curl -LsSf https://github.com/taiki-e/cargo-llvm-cov/releases/latest/download/cargo-llvm-cov-x86_64-unknown-linux-gnu.tar.gz | tar xzf - -C ~/.cargo/bin
- name: Generate coverage report
run: |
cargo llvm-cov clean --workspace
cargo llvm-cov --no-report --all-features
cargo llvm-cov report --lcov > lcov.txt
- name: Upload coverage report
uses: codecov/codecov-action@v4
with:
files: ./lcov.txt
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}