name: CI
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
std: ["std", "no-std"]
toolchain: [nightly]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
id: toolchain
with:
toolchain: ${{ matrix.toolchain }}
profile: minimal
components: rustfmt, clippy, miri
override: true
- name: Setup cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-test-rustc-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/cargo@v1
if: runner.os == 'linux'
with:
command: fmt
args: --all -- --check
- uses: actions-rs/clippy-check@v1
if: runner.os == 'linux'
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features -- -D warnings
- uses: actions-rs/cargo@v1
if: matrix.std == 'no-std'
with:
command: build
args: --no-default-features --features "serde"
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0"
- uses: actions-rs/cargo@v1
if: matrix.std == 'std'
with:
command: miri
args: test --all-features
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0"