From e8d139d720c06a27c3ac4c48d83be719774c9fa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Rami=CC=81rez=20Mondrago=CC=81n?= Date: Tue, 11 Apr 2023 01:31:19 -0600 Subject: [PATCH] chore: Run `cargo fmt` and `cargo clippy` in CI --- .github/workflows/lint.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a94cd8a..907c917 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -5,7 +5,33 @@ on: branches: - dev pull_request: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + jobs: + cargo-fmt: + name: "cargo fmt" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: "Install Rust toolchain" + run: rustup component add rustfmt + - run: cargo fmt --check + + cargo-clippy: + name: "cargo clippy" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: "Install Rust toolchain" + run: | + rustup component add clippy + - uses: Swatinem/rust-cache@v2 + - run: cargo clippy + pre-commit: runs-on: ubuntu-latest env: