diff --git a/.github/workflows/code_style.yml b/.github/workflows/code_style.yml new file mode 100644 index 0000000..f76e5ed --- /dev/null +++ b/.github/workflows/code_style.yml @@ -0,0 +1,29 @@ +name: Code Style + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + CARGO_TERM_COLOR: always + +jobs: + codestyle: + name: Code Style (fmt + clippy) + runs-on: ubuntu-20.04 + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + profile: minimal + components: rustfmt + - name: Check formatting + run: cargo fmt --all -- --check + - name: Check lints (cargo clippy) + run: cargo clippy -- -D warnings