name: Check Code
on:
push:
paths-ignore:
- 'docs/'
- '*.md'
pull_request:
paths-ignore:
- 'docs/'
- '*.md'
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
test:
name: Run tests
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
rust: [nightly]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
components: rustfmt
override: true
- name: Load cargo cache
id: cache
uses: ./.github/actions/cargo-cache
- name: Cargo build
uses: actions-rs/cargo@v1
with:
command: build
- name: Cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace
check:
name: Check style
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: clippy, rustfmt
override: true
- name: Load cargo cache
id: cache
uses: ./.github/actions/cargo-cache
- name: Check clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --workspace --tests --all-features -- -D warnings
- name: Check format
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
tidy:
name: Check tidy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rustfmt
override: true
- name: Load cargo cache
id: cache
uses: ./.github/actions/cargo-cache
- name: Cargo build
uses: actions-rs/cargo@v1
with:
command: build
- name: Verify tidy
run: git diff --exit-code