From f408eb32085956f7e29e0f15fd92aa4b72453370 Mon Sep 17 00:00:00 2001 From: KyleMiles Date: Tue, 16 Apr 2024 14:54:48 -0400 Subject: [PATCH] Adds a GitHub action that runs `cargo check` and `cargo clippy` on incoming PRs that modify anything in the ./rust folder This will make it a lot easier to approve PRs that don't have breaking API changes --- .github/workflows/rust.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/rust.yml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 000000000..a5281521a --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,38 @@ +name: Rust PR Checks + +on: + pull_request: + paths: + - 'rust/**' + +jobs: + build_and_lint: + name: cargo check & cargo clippy + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install Clang + run: | + sudo apt update + sudo apt install clang -y + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: 1.77.0 + profile: minimal + override: true + components: clippy + + - name: cargo check + working-directory: ./rust + run: cargo check --workspace + + - name: cargo clippy + working-directory: ./rust + run: cargo clippy -- -D warnings + continue-on-error: true + # If this step fails, it will warn (?)