2022-02-04 18:29:55 +01:00
|
|
|
name: Lint, Build, Test
|
2021-07-31 23:10:07 +02:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2023-06-23 19:46:55 +02:00
|
|
|
branches: [master, main]
|
2021-07-31 23:10:07 +02:00
|
|
|
pull_request:
|
2023-06-23 19:46:55 +02:00
|
|
|
branches: [master, main]
|
2021-07-31 23:10:07 +02:00
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
2023-06-29 14:33:34 +02:00
|
|
|
test:
|
2021-07-31 23:10:07 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2023-06-23 19:46:55 +02:00
|
|
|
- run: rustup component add clippy rustfmt
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Rust Cache
|
2023-06-29 16:38:37 +02:00
|
|
|
uses: Swatinem/rust-cache@v2.5.0
|
2023-06-23 19:46:55 +02:00
|
|
|
- name: Check format
|
|
|
|
run: cargo fmt --all -- --check
|
|
|
|
- name: Check
|
|
|
|
run: cargo check --verbose --all-targets --all-features
|
|
|
|
- name: Clippy
|
|
|
|
run: cargo clippy --workspace --no-deps --all-features --all-targets -- -D warnings
|
|
|
|
- name: Validate documentation
|
|
|
|
run: cargo doc --workspace --no-deps --all-features
|
|
|
|
- name: Run tests
|
2023-08-10 14:55:06 +02:00
|
|
|
run: cargo test --verbose --all-features --all-targets --workspace
|
2023-06-29 14:33:34 +02:00
|
|
|
check:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
target: [x86_64-unknown-linux-musl, x86_64-pc-windows-gnu]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Rust Cache
|
2023-06-29 16:38:37 +02:00
|
|
|
uses: Swatinem/rust-cache@v2.5.0
|
2023-06-29 16:51:41 +02:00
|
|
|
with:
|
|
|
|
prefix-key: v0-rust-${{ matrix.target }}
|
2023-06-29 14:33:34 +02:00
|
|
|
- name: Install Cross
|
|
|
|
uses: baptiste0928/cargo-install@v1
|
|
|
|
with:
|
|
|
|
crate: cross
|
|
|
|
- name: Check
|
|
|
|
run: cross check --verbose --all-targets --all-features --target ${{ matrix.target }}
|