From bf67f7b1f4fab4d39edcad4cef919885017da344 Mon Sep 17 00:00:00 2001 From: siddhantCodes Date: Fri, 11 Oct 2024 12:30:51 +0530 Subject: [PATCH] CI: workflow to check formatting, clippy and, tests --- .github/workflows/test.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..774bea6 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,37 @@ +name: Tests and Formatting + +on: + workflow_dispatch: + push: + branches: [ main ] + pull_request: + branches: [ main ] +jobs: + everything: + name: Rust/JS Checks/Formatting + runs-on: ubuntu-latest + steps: + - name: Check out + uses: actions/checkout@v3 + - uses: Swatinem/rust-cache@v2 + - name: Run cargo fmt + id: fmt + run: cargo fmt --all -- --check + continue-on-error: true + - name: Run cargo clippy + id: clippy + continue-on-error: true + run: cargo clippy --all -- -D warnings + - name: Run cargo test + id: test + continue-on-error: true + run: cargo test + - name: Check if code is properly formatted + if: steps.fmt.outcome != 'success' + run: exit 1 + - name: Check if clippy is happy + if: steps.clippy.outcome != 'success' + run: exit 1 + - name: Check if test succeeded + if: steps.test.outcome != 'success' + run: exit 1