From 39b18ecec55411e7eebcea3503a1ce05e3807ed8 Mon Sep 17 00:00:00 2001 From: Adrian Date: Sat, 15 Jul 2023 12:22:36 +0300 Subject: [PATCH] Add CI steps for tests - linting - formatting --- .github/workflows/Tests.yml | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/Tests.yml diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml new file mode 100644 index 0000000..466f53d --- /dev/null +++ b/.github/workflows/Tests.yml @@ -0,0 +1,42 @@ +name: Rust + +on: + pull_request: + branches: [ "master", "develop" ] + +env: + CARGO_TERM_COLOR: always + +jobs: + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - name: Run tests + run: cargo test + + fmt: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt + - name: Enforce formatting + run: cargo fmt --check + + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + components: clippy + - uses: Swatinem/rust-cache@v2 + - name: Linting + run: cargo clippy -- -D warnings