name: CI
on:
push:
branches: [main, master]
pull_request:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-D warnings"
jobs:
fmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all --check
clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: clippy (all features)
run: cargo clippy --all-features --all-targets -- -D warnings
- name: clippy (sync, webhooks; no default)
run: cargo clippy --no-default-features --features sync,webhooks --all-targets -- -D warnings
test:
name: test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: test (all features)
run: cargo test --all-features
- name: test (default features)
run: cargo test
- name: test (sync, webhooks; no default)
run: cargo test --no-default-features --features sync,webhooks
docs:
name: doc
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: "--cfg docsrs -D warnings"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
- run: cargo doc --all-features --no-deps