name: PullRequests
on:
pull_request:
branches:
- main
env:
RUST_VERSION_STABLE: 1.80.1
CRATE_PATHS: .
jobs:
testing:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_VERSION_STABLE }}
profile: minimal
override: true
- name: Checking
run: cargo c
- name: Testing
run: cargo t
lint-rust:
runs-on: ubuntu-latest
needs: testing
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_VERSION_STABLE }}
profile: minimal
components: rustfmt, clippy
override: true
- name: Run clippy
run: cargo clippy --all-targets -- -D warnings $(cat lint | cut -f1 -d"#" | tr '\n' ' ')
- name: Run rustfmt
run: cargo fmt -- --check