name: Check Code
on:
push:
branches:
- '*'
- '!staging.tmp'
tags:
- '*'
jobs:
test:
name: "Test"
strategy:
matrix:
os: [
ubuntu-latest,
macos-latest,
windows-latest
]
rust: [nightly, beta, stable]
runs-on: ${{ matrix.os }}
steps:
- name: "Checkout Repository"
uses: actions/checkout@master
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-build-target-${{ hashFiles('**/Cargo.toml') }}
- name: Release build
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Release build without default features
uses: actions-rs/cargo@v1
with:
command: build
args: --release --no-default-features
- name: Cargo test
uses: actions-rs/cargo@v1
with:
command: test
- name: Cargo test without default features
uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features
check:
name: "Clippy & Format"
runs-on: ubuntu-latest
steps:
- name: "Checkout Repository"
uses: actions/checkout@master
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt, clippy
override: true
- name: Clippy warnings
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
- name: Cargo Fmt Check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check