name: Main
on:
workflow_dispatch:
push:
paths-ignore:
- "*.md"
- ".gitignore"
- "LICENSE"
branches:
- master
tags:
- "**"
pull_request:
paths-ignore:
- "*.md"
- ".gitignore"
- "LICENSE"
branches:
- master
jobs:
codestyle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add rustfmt
shell: bash
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add clippy
shell: bash
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-features --all-targets -- -Dclippy::all
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: check
test:
needs: [codestyle, lint, check]
strategy:
matrix:
rust: [stable, beta, nightly]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --all-targets --all-features