general: repo improvements #36
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
jobs: | ||
test: | ||
name: test ${{ matrix.flags.name }} (${{ matrix.os }}) | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 30 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ["ubuntu-latest", "macos-latest", "windows-latest"] | ||
rust: ["stable", "beta", "nightly", "1.65"] | ||
exclude: | ||
- rust: "1.65" # MSRV | ||
flag: "--all-features" | ||
flags: | ||
- name: no default features | ||
flags: --no-default-features | ||
- name: default features | ||
flags: "" | ||
- name: all features | ||
flags: --all-features | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- name: Install test binaries | ||
shell: bash | ||
run: ./.github/scripts/install_test_binaries.sh | ||
- name: Install nextest | ||
uses: taiki-e/install-action@nextest | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: build | ||
if: ${{ matrix.rust == '1.65' }} # MSRV | ||
run: cargo build --workspace ${{ matrix.flags}} | ||
- name: test ${{ matrix.flags.flags }} | ||
shell: bash | ||
run: | | ||
cargo nextest run \ | ||
${{ matrix.flags.flags }} \ | ||
-E "!(kind(test))" \ | ||
--retries 2 | ||
feature-checks: | ||
name: feature checks | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 45 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- uses: taiki-e/install-action@cargo-hack | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: cargo hack | ||
run: cargo hack check --feature-powerset --depth 1 --all-targets | ||
clippy: | ||
name: clippy | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dtolnay/rust-toolchain@clippy | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: clippy | ||
run: cargo clippy --workspace --all-features --all-targets | ||
env: | ||
RUSTFLAGS: "-D warnings" | ||
docs: | ||
name: docs | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dtolnay/rust-toolchain@nightly | ||
with: | ||
components: rust-docs | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: doc | ||
run: cargo doc --workspace --all-features --no-deps --document-private-items | ||
env: | ||
RUSTDOCFLAGS: "--cfg docsrs -D warnings" | ||
fmt: | ||
name: fmt | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dtolnay/rust-toolchain@nightly | ||
with: | ||
components: rustfmt | ||
- name: fmt --check | ||
run: cargo fmt --all --check |