name: CI
on:
pull_request:
push:
branches:
- main
paths-ignore:
- '**/*.md'
- LICENSE
- '**/*.gitignore'
- .editorconfig
jobs:
lint:
name: Lint, check formating and docs
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add clippy
- run: rustup component add rustfmt
- name: Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
- name: Formating
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Rustdoc
uses: actions-rs/cargo@v1
with:
command: rustdoc
args: -- -D warnings
build:
needs: [lint]
name: Build and test project on Rust ${{ matrix.rust }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- { rust: stable, os: macos-latest }
- { rust: stable, os: windows-latest }
- { rust: stable, os: ubuntu-latest }
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: 16
check-latest: true
cache: yarn
- name: Install dependencies
run: yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release