From a476092bcd53d8d28d8d538dc8b949c7ec9cbe3b Mon Sep 17 00:00:00 2001 From: Nick Johnson Date: Fri, 1 Mar 2024 08:42:05 -0800 Subject: [PATCH] Add lint and format checks to CI --- .github/workflows/ci.yml | 15 ++++++++++++--- .gitignore | 2 ++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d73cad0..a097085 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,8 @@ name: Cargo Build & Test on: push: + branches: + - main pull_request: jobs: @@ -16,8 +18,15 @@ jobs: - nightly steps: - uses: actions/checkout@v3 - - run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} - - run: cargo build --verbose - - run: cargo test --verbose + - name: Update Toolchain + run: rustup default ${{ matrix.toolchain }} && rustup component add --toolchain ${{ matrix.toolchain }} rustfmt && rustup component add --toolchain ${{ matrix.toolchain }} clippy && rustup update ${{ matrix.toolchain }} + - name: Build + run: cargo build --verbose + - name: Lint + run: cargo clippy --all --all-targets + - name: Format + run: cargo fmt --all -- --check + - name: Test + run: cargo test --verbose diff --git a/.gitignore b/.gitignore index ea8c4bf..0a76350 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ /target +# IDEs +.vscode/