make CI faster and more comprehensive (#207)
This commit is contained in:
parent
cbc46ad8eb
commit
4deff5f633
1 changed files with 16 additions and 28 deletions
44
.github/workflows/rust.yml
vendored
44
.github/workflows/rust.yml
vendored
|
@ -2,41 +2,29 @@ name: Lint, Build, Test
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master, main ]
|
branches: [master, main]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master, main ]
|
branches: [master, main]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- run: rustup component add clippy rustfmt
|
||||||
- name: Build
|
- uses: actions/checkout@v3
|
||||||
run: cargo build --workspace --verbose
|
- name: Rust Cache
|
||||||
- name: Run tests
|
uses: Swatinem/rust-cache@v2.2.1
|
||||||
run: cargo test --workspace --verbose
|
- name: Check format
|
||||||
lint:
|
run: cargo fmt --all -- --check
|
||||||
name: rustfmt
|
- name: Check
|
||||||
runs-on: ubuntu-latest
|
run: cargo check --verbose --all-targets --all-features
|
||||||
steps:
|
- name: Clippy
|
||||||
- name: Checkout sources
|
run: cargo clippy --workspace --no-deps --all-features --all-targets -- -D warnings
|
||||||
uses: actions/checkout@v2
|
- name: Validate documentation
|
||||||
|
run: cargo doc --workspace --no-deps --all-features
|
||||||
- name: Install stable toolchain
|
- name: Run tests
|
||||||
uses: actions-rs/toolchain@v1
|
run: cargo test --verbose
|
||||||
with:
|
|
||||||
profile: minimal
|
|
||||||
toolchain: stable
|
|
||||||
override: true
|
|
||||||
components: rustfmt
|
|
||||||
|
|
||||||
- name: Run cargo fmt
|
|
||||||
uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: fmt
|
|
||||||
args: --all -- --check
|
|
||||||
|
|
Loading…
Reference in a new issue