Skip to content

Merge pull request #74 from james-ecd/dependabot/cargo/random-string-… #159

Merge pull request #74 from james-ecd/dependabot/cargo/random-string-…

Merge pull request #74 from james-ecd/dependabot/cargo/random-string-… #159

name: Rust Tests and Linting
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.cargo
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: Install dependencies
run: |
cargo install cargo-tarpaulin
rustup component add rustfmt-preview
- name: Run tests
run: |
cargo test --all
- name: Run linting
run: |
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
- name: Generate coverage report
run: |
cargo tarpaulin --out xml
bash <(curl -s https://codecov.io/bash)
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}