Simplify Gitea Actions check, lint and test workflow
Check, lint and test using Cargo / Check, lint and test (push) Successful in 6m20s Details

This commit is contained in:
Paul van Tilburg 2023-04-25 16:38:59 +02:00
parent a289bd9ef0
commit d84440304a
Signed by: paul
GPG Key ID: C6DE073EDA9EEC4D
1 changed files with 18 additions and 52 deletions

View File

@ -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