summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorKyleMiles <krm504@nyu.edu>2024-04-16 14:54:48 -0400
committerKyleMiles <krm504@nyu.edu>2024-04-16 14:57:25 -0400
commitf408eb32085956f7e29e0f15fd92aa4b72453370 (patch)
tree684ca70e43f9729a15543463720ee383322b4ad7 /.github
parent3e19f70c7640700ee8065807a7ead971aae47762 (diff)
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
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/rust.yml38
1 files changed, 38 insertions, 0 deletions
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
new file mode 100644
index 00000000..a5281521
--- /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 (?)