name: CI
on:
push:
pull_request:
schedule: [cron: "40 1 * * *"]
permissions:
contents: read
env:
RUSTFLAGS: -Dwarnings
jobs:
load:
name: Load
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
- name: wget https://static.crates.io/db-dump.tar.gz
run: wget --quiet --user-agent=github.com/dtolnay/db-dump https://static.crates.io/db-dump.tar.gz
- run: cargo run --release --example load-all
env:
RUSTFLAGS: --cfg db_dump_panic_on_unrecognized_csv ${{env.RUSTFLAGS}}
build:
name: Rust ${{matrix.rust}}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust: [nightly, beta, stable, 1.65.0]
timeout-minutes: 45
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.rust}}
- run: cargo check --workspace
- run: cargo check --examples
env:
RUSTFLAGS: -Adeprecated ${{env.RUSTFLAGS}} - run: cargo check --features serde/derive
- run: cargo test --lib
- run: cargo test --doc
clippy:
name: Clippy
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
timeout-minutes: 45
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@clippy
- run: cargo clippy --tests --workspace -- -Dclippy::all -Dclippy::pedantic
- run: cargo clippy --examples -- -Dclippy::all -Dclippy::pedantic -Aclippy::cast_lossless -Aclippy::cast_precision_loss -Aclippy::doc_markdown -Aclippy::from_iter_instead_of_collect -Aclippy::uninlined_format_args
env:
RUSTFLAGS: -Adeprecated ${{env.RUSTFLAGS}}
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
- run: cargo outdated --workspace --exit-code 1