Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add automated checks to pull requests #15

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
on:
pull_request:
workflow_dispatch:

name: Clippy check

# Make sure CI fails on all warnings, including Clippy lints
env:
RUSTFLAGS: "-Dwarnings"

jobs:
fmt_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check if code is formatted properly
run: cargo fmt --check --all

clippy_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache Cargo Registry
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }}
- name: Run Clippy
run: cargo clippy --all-targets --all-features

udeps:
runs-on: ubuntu-latest
steps:
- name: Cache Cargo Binaries
uses: actions/cache@v3
with:
path: ~/.cargo/bin
key: ${{ runner.os }}-cargo-bin
restore-keys: |
${{ runner.os }}-cargo-bin

- name: Cache Rust Toolchain
uses: actions/cache@v3
with:
path: |
~/.rustup/toolchains
~/.rustup/update-hashes
key: ${{ runner.os }}-rust-toolchain-${{ hashFiles('rust-toolchain') }}
restore-keys: |
${{ runner.os }}-rust-toolchain-${{ hashFiles('rust-toolchain') }}

- name: Cache Cargo Registry
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }}

- uses: actions/checkout@v4
- name: Install nightly
run: rustup toolchain install nightly
- name: Install udeps
run: cargo install cargo-udeps --locked
- name: Run udeps
run: cargo +nightly udeps
Loading