name: Build
on: [push, pull_request]
jobs:
check:
name: Type checking
runs-on: ${{ matrix.os }}
strategy:
matrix:
rust: [1.34.0, 1.36.0, stable]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- name: Checkout sources
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- name: Run `cargo check --no-default-features`
uses: actions-rs/cargo@v1
with:
command: check
args: --no-default-features
if: matrix.rust != '1.34.0'
- name: Run `cargo check --no-default-features --features serde`
uses: actions-rs/cargo@v1
with:
command: check
args: --no-default-features --features serde
if: matrix.rust != '1.34.0'
- name: Run `cargo check --all-features`
uses: actions-rs/cargo@v1
with:
command: check
args: --all-features
test:
name: Test suite
runs-on: ${{ matrix.os }}
strategy:
matrix:
rust: [1.34.0, 1.36.0, stable] os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- name: Checkout sources
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- name: Run `cargo test --no-default-features`
uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features
if: matrix.rust != '1.34.0'
- name: Run `cargo test --all-features`
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features
fmt:
name: Formatting
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly override: true
- name: Install rustfmt
run: rustup component add rustfmt
- name: Run `cargo fmt -- --check`
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install clippy
run: rustup component add clippy
- name: Run `cargo clippy --features serde,deprecated`
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --features serde,deprecated