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:35:50 +02:00
|
|
|
uses: Swatinem/rust-cache@v2.5
|
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
|
|
|
|
run: cargo test --verbose
|
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:35:50 +02:00
|
|
|
uses: Swatinem/rust-cache@v2.5
|
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 }}
|