Skip to content

chore: add coverage (#2) #42

chore: add coverage (#2)

chore: add coverage (#2) #42

Workflow file for this run

name: Continuous Integration
on:
push:
branches:
- main
pull_request:
jobs:
fmt:
name: Fmt
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt
- name: Restore cache
uses: Swatinem/rust-cache@v1
- name: Run fmt
run: cargo fmt --all --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: clippy
- name: Restore cache
uses: Swatinem/rust-cache@v1
- name: Run clippy
run: cargo clippy --all-targets --all-features --locked -- -D warnings
check:
name: Check
strategy:
fail-fast: false
matrix:
rust:
- stable
- beta
- nightly
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
- name: Run check
run: cargo check --all-targets --locked
test:
name: Test
strategy:
fail-fast: false
matrix:
rust:
- stable
- beta
- nightly
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
- name: Run test
run: cargo test --all-targets --locked
coverage:
name: Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools
- name: Install llvm-cov
uses: taiki-e/install-action@v2.33.16
with:
tool: cargo-llvm-cov
- run: cargo llvm-cov --all-features --lcov --output-path lcov.info
- name: Upload coverage to coveralls
uses: coverallsapp/github-action@v2.2.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: lcov.info