Skip to content

Merge pull request #18 from pluots/update-ci #79

Merge pull request #18 from pluots/update-ci

Merge pull request #18 from pluots/update-ci #79

---
# Main "useful" actions config file
# Cache config comes from https://github.com/actions/cache/blob/main/examples.md#rust---cargo
on:
push:
branches:
- main
pull_request:
name: Rust Validation
env:
RUSTDOCFLAGS: -D warnings
RUSTFLAGS: -D warnings
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
jobs:
clippy:
name: "Clippy (cargo clippy)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all-features --all-targets -- -D warnings
- run: cargo clippy --no-default-features --all-targets -- -D warnings
test:
strategy:
fail-fast: true
matrix:
include:
- build: linux
os: ubuntu-latest
target: x86_64-unknown-linux-musl
extension: ''
- build: macos
os: macos-latest
target: x86_64-apple-darwin
extension: ''
- build: windows-msvc
os: windows-latest
target: x86_64-pc-windows-msvc
name: "Test on ${{ matrix.os }} (cargo test)"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
lfs: true
- uses: dtolnay/[email protected]
- uses: Swatinem/rust-cache@v2
- run: cargo test -- --nocapture
fmt:
name: "Format (cargo fmt)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --all -- --check
- uses: actions/setup-python@v3
doc:
name: "Docs (cargo doc)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
- run: cargo doc
outdated:
name: Outdated
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
timeout-minutes: 45
steps:
- uses: actions/checkout@v3
- uses: dtolnay/install@cargo-outdated
- uses: Swatinem/rust-cache@v2
- run: cargo outdated --workspace --exit-code 1