diff --git a/.gitea/workflows/cargo.yml b/.gitea/workflows/check-lint-test.yml similarity index 52% rename from .gitea/workflows/cargo.yml rename to .gitea/workflows/check-lint-test.yml index 9ed42e8..c807925 100644 --- a/.gitea/workflows/cargo.yml +++ b/.gitea/workflows/check-lint-test.yml @@ -1,58 +1,13 @@ -name: "Check, Test and Lint Using Cargo" +name: "Check, lint and test using Cargo" on: - - push - pull_request + - push - 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: Use sparse Cargo index for crates.io - run: echo -e '[registries.crates-io]\nprotocol = "sparse"' >> /root/.cargo/config.toml - - - 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: Use sparse Cargo index for crates.io - run: echo -e '[registries.crates-io]\nprotocol = "sparse"' >> /root/.cargo/config.toml - - - name: Run cargo test - uses: https://github.com/actions-rs/cargo@v1 - with: - command: test - args: --all-features - - lints: - name: Lints + check_lint: + name: Check, lint and test runs-on: debian-latest steps: - name: Checkout sources @@ -69,14 +24,25 @@ jobs: - name: Use sparse Cargo index for crates.io run: echo -e '[registries.crates-io]\nprotocol = "sparse"' >> /root/.cargo/config.toml - - name: Run cargo fmt + - name: Run cargo check uses: https://github.com/actions-rs/cargo@v1 with: - command: fmt - args: --all -- --check + command: check - name: Run cargo clippy uses: https://github.com/actions-rs/cargo@v1 with: command: clippy args: -- -D warnings + + - name: Run cargo fmt + uses: https://github.com/actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + + - name: Run cargo test + uses: https://github.com/actions-rs/cargo@v1 + with: + command: test + args: --all-features