name: CI
on:
pull_request:
push:
branches:
- main
tags:
- 'v*.*.*'
env:
CARGO_TERM_COLOR: always
jobs:
style:
name: Check Style
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
override: true
- name: cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
test:
name: Run Tests
needs: [style]
runs-on: ubuntu-latest
strategy:
matrix:
target:
- x86_64-pc-windows-gnu
- x86_64-unknown-linux-gnu
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
target: ${{ matrix.target }}
- name: Test
uses: actions-rs/cargo@v1
with:
use-cross: true
command: test
args: --target ${{ matrix.target }}