typos/.github/workflows/ci.yml

145 lines
3.8 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
needs: [smoke, test, msrv, docs, rustfmt, clippy]
runs-on: ubuntu-latest
steps:
- name: Done
run: exit 0
2021-07-01 16:45:56 -04:00
smoke:
name: Quick Check
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: 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
test:
name: Test
needs: smoke
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
- 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:
2021-11-08 12:36:05 -05:00
name: "Check MSRV: 1.54.0"
2021-07-01 16:45:56 -04:00
needs: smoke
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
2021-11-08 12:36:05 -05:00
toolchain: 1.54.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
needs: smoke
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
run: cargo doc --no-deps --document-private-items --workspace
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:
2021-11-08 12:36:05 -05:00
toolchain: 1.54.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 }}
args: --workspace --all-features --all-targets -- -D warnings