typos/.github/workflows/ci.yml

125 lines
3.2 KiB
YAML
Raw Normal View History

2021-07-01 16:45:56 -04:00
name: ci
on:
pull_request:
paths:
- '**'
- '!/*.md'
- '!/docs/**'
- "!/LICENSE-*"
push:
branches:
- master
paths:
- '**'
- '!/*.md'
- '!/docs/**'
- "!/LICENSE-*"
2021-11-08 11:11:02 -05:00
schedule:
- cron: '3 3 3 * *'
2021-07-01 16:45:56 -04:00
jobs:
2021-08-16 12:23:25 -04:00
ci:
name: CI
2022-02-15 14:31:29 -05:00
needs: [test, msrv, docs, rustfmt, clippy]
2021-08-16 12:23:25 -04:00
runs-on: ubuntu-latest
steps:
- name: Done
run: exit 0
2021-07-01 16:45:56 -04:00
test:
name: Test
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
2021-07-07 16:38:16 -04:00
rust: ["stable"]
2021-07-01 16:45:56 -04:00
continue-on-error: ${{ matrix.rust != 'stable' }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
2021-07-01 17:23:13 -04:00
override: true
2021-07-01 16:45:56 -04:00
- uses: Swatinem/rust-cache@v1
2022-02-15 14:31:29 -05:00
- name: Build
run: cargo test --no-run --workspace --all-features
2021-07-01 16:45:56 -04:00
- name: Default features
run: cargo test --workspace
- name: All features
run: cargo test --workspace --all-features
- name: No-default features
run: cargo test --workspace --no-default-features
msrv:
2022-10-04 11:51:03 -04:00
name: "Check MSRV: 1.64.0"
2021-07-01 16:45:56 -04:00
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
2022-10-04 11:51:03 -04:00
toolchain: 1.64.0 # MSRV
2021-07-01 16:45:56 -04:00
profile: minimal
2021-07-01 17:23:13 -04:00
override: true
2021-07-01 16:45:56 -04:00
- uses: Swatinem/rust-cache@v1
- name: Default features
run: cargo check --workspace --all-targets
- name: All features
run: cargo check --workspace --all-targets --all-features
- name: No-default features
run: cargo check --workspace --all-targets --no-default-features
docs:
name: Docs
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
2021-07-01 17:23:13 -04:00
override: true
2021-07-01 16:45:56 -04:00
- uses: Swatinem/rust-cache@v1
- name: Check documentation
env:
RUSTDOCFLAGS: -D warnings
2022-02-15 14:31:29 -05:00
run: cargo doc --workspace --all-features --no-deps --document-private-items
2021-07-01 16:45:56 -04:00
rustfmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
2021-11-08 11:11:02 -05:00
# Not MSRV because its harder to jump between versions and people are
# more likely to have stable
2021-07-01 16:45:56 -04:00
toolchain: stable
profile: minimal
2021-07-01 17:23:13 -04:00
override: true
2021-07-01 16:45:56 -04:00
components: rustfmt
- uses: Swatinem/rust-cache@v1
- name: Check formatting
run: cargo fmt --all -- --check
clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
2022-10-04 11:51:03 -04:00
toolchain: 1.64.0 # MSRV
2021-07-01 16:45:56 -04:00
profile: minimal
2021-07-01 17:23:13 -04:00
override: true
2021-07-01 16:45:56 -04:00
components: clippy
- uses: Swatinem/rust-cache@v1
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
2022-02-15 14:31:29 -05:00
args: --workspace --all-features --all-targets -- -D warnings --allow deprecated