From 3de66dbd41db5e02249aa703aaee96350fb90c09 Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Tue, 21 Mar 2023 11:15:55 +0100 Subject: [PATCH] Add Gitea Actions (CI) workflow for cargo --- .gitea/workflows/cargo.yml | 73 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .gitea/workflows/cargo.yml diff --git a/.gitea/workflows/cargo.yml b/.gitea/workflows/cargo.yml new file mode 100644 index 0000000..619920e --- /dev/null +++ b/.gitea/workflows/cargo.yml @@ -0,0 +1,73 @@ +name: "Check, Test and Lint Using Cargo" + +on: + - push + - pull_request + - workflow_dispatch + +jobs: + check: + name: Check + runs-on: debian-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Install stable toolchain + uses: https://github.com/actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + + - name: Run cargo check + uses: https://github.com/actions-rs/cargo@v1 + with: + command: check + + test: + name: Test Suite + runs-on: debian-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Install stable toolchain + uses: https://github.com/actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + + - name: Run cargo test + uses: https://github.com/actions-rs/cargo@v1 + with: + command: test + args: --all-features + + lints: + name: Lints + runs-on: debian-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Install stable toolchain + uses: https://github.com/actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: rustfmt, clippy + + - name: Run cargo fmt + uses: https://github.com/actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + + - name: Run cargo clippy + uses: https://github.com/actions-rs/cargo@v1 + with: + command: clippy + args: -- -D warnings