From f2f90ffc0836099d36da9c8780d0e39237d3a8d1 Mon Sep 17 00:00:00 2001 From: Rahul Garg Date: Sun, 19 Nov 2023 22:12:32 -0700 Subject: [PATCH] Add workflow --- .github/workflows/rust.yml | 35 +++++++++++++++++++++++++++++++++++ .gitignore | 3 +++ 2 files 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 0000000..0a96e27 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,35 @@ +name: CI + +on: + pull_request: + branches: [main] + push: + branches: [main] + tags: ["*"] + +jobs: + rust: + runs-on: ubuntu-latest + steps: + - name: Setup | Cancel previous runs + uses: styfle/cancel-workflow-action@0.11.0 + + - name: Setup | Checkout + uses: actions/checkout@v3 + + - name: Setup | Apt packages + run: sudo apt-get update + + - name: Setup | Rust toolchain + uses: dtolnay/rust-toolchain@1.70.0 + with: + components: clippy, rustfmt + + - name: Setup | Rust cache + uses: Swatinem/rust-cache@v2 + + - name: Hygiene | Formatting + run: cargo fmt -- --check + + - name: Hygiene | Clippy + run: cargo clippy -- -Dclippy::all -Dwarnings diff --git a/.gitignore b/.gitignore index 6e2a140..a036840 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,6 @@ !src !src/* !src/**/* +!.github +!.github/* +!.github/**/*