Skip to content

chore(CI): fix CI and linter warnings #412

chore(CI): fix CI and linter warnings

chore(CI): fix CI and linter warnings #412

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
check-all:
runs-on: ubuntu-latest
strategy:
matrix:
registry:
- crates
- github
- npm
- pypi
http_client:
- ureq
- reqwest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo check --no-default-features --features ${{ matrix.registry }},${{ matrix.http_client }}
- run: cargo fmt --all --check
- run: cargo clippy --no-default-features --features ${{ matrix.registry }},${{ matrix.http_client }} -- -D warnings
- run: cargo build --release --no-default-features --features ${{ matrix.registry }},${{ matrix.http_client }}
test-coverage:
runs-on: ubuntu-latest
strategy:
matrix:
all_registries: [ "crates,github,npm,pypi" ]
http_client:
- ureq
- reqwest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: llvm-tools-preview
# https://github.com/dtolnay/rust-toolchain/issues/29
- run: rustup override set nightly
- uses: baptiste0928/cargo-install@v3
with:
crate: grcov
- run: cargo clean
- uses: Swatinem/rust-cache@v2
- run: cargo test --no-fail-fast --no-default-features --features ${{ matrix.all_registries }},${{ matrix.http_client }}
env:
CARGO_INCREMENTAL: '0'
LLVM_PROFILE_FILE: 'target/debug/coverage/update-informer-%p-%m.profraw'
RUSTFLAGS: '-Cinstrument-coverage'
- run: grcov . -s . --binary-path ./target/debug/ -t lcov --branch --ignore-not-existing -o ./target/debug/coverage/
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: target/debug/coverage/lcov
cargo-sort:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo install cargo-sort
- run: cargo-sort --check
links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: lycheeverse/lychee-action@v2
with:
args: . --verbose --exclude "pkg_name|your_own_registry"
fail: true
style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dprint/[email protected]