2023-04-25 16:36:49 +02:00
|
|
|
name: "Check and lint using Cargo"
|
|
|
|
|
|
|
|
on:
|
|
|
|
- pull_request
|
|
|
|
- push
|
|
|
|
- workflow_dispatch
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
check_lint:
|
|
|
|
name: Check and lint
|
|
|
|
runs-on: debian-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2023-05-22 20:10:45 +02:00
|
|
|
- name: Install Rust stable toolchain
|
2023-04-25 16:36:49 +02:00
|
|
|
uses: https://github.com/actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
components: rustfmt, clippy
|
|
|
|
|
|
|
|
- name: Run cargo check
|
|
|
|
uses: https://github.com/actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: check
|
|
|
|
|
|
|
|
- name: Run cargo clippy
|
|
|
|
uses: https://github.com/actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: clippy
|
|
|
|
args: -- -D warnings
|
|
|
|
|
|
|
|
- name: Run cargo fmt
|
|
|
|
uses: https://github.com/actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: fmt
|
|
|
|
args: --all -- --check
|
|
|
|
|
|
|
|
# TODO: Add a test suite first!
|
|
|
|
# - name: Run cargo test
|
|
|
|
# uses: https://github.com/actions-rs/cargo@v1
|
|
|
|
# with:
|
|
|
|
# command: test
|
|
|
|
# args: --all-features
|