2020-12-08 10:21:09 +00:00
|
|
|
name: CI
|
2020-12-08 09:42:05 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
2020-12-08 10:21:09 +00:00
|
|
|
style:
|
|
|
|
name: Check style
|
2020-12-08 09:42:05 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2020-12-08 10:08:41 +00:00
|
|
|
- name: Checkout the repo
|
|
|
|
uses: actions/checkout@v2
|
2020-12-08 10:21:09 +00:00
|
|
|
|
2020-12-08 10:08:41 +00:00
|
|
|
- name: Install rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
2020-12-08 09:42:05 +00:00
|
|
|
with:
|
|
|
|
toolchain: stable
|
2020-12-08 10:21:09 +00:00
|
|
|
components: rustfmt
|
|
|
|
profile: minimal
|
|
|
|
override: true
|
2020-12-08 09:42:05 +00:00
|
|
|
|
2020-12-08 10:08:41 +00:00
|
|
|
- name: Cargo fmt
|
|
|
|
uses: actions-rs/cargo@v1
|
2020-12-08 09:42:05 +00:00
|
|
|
with:
|
|
|
|
command: fmt
|
2020-12-08 09:44:19 +00:00
|
|
|
args: --all -- --check
|
2020-12-08 09:42:05 +00:00
|
|
|
|
2020-12-08 10:21:09 +00:00
|
|
|
clippy:
|
|
|
|
name: Run clippy
|
|
|
|
needs: [style]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout the repo
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
components: clippy
|
|
|
|
profile: minimal
|
|
|
|
override: true
|
|
|
|
|
2020-12-08 10:08:41 +00:00
|
|
|
- name: Clippy
|
|
|
|
uses: actions-rs/cargo@v1
|
2020-12-08 09:42:05 +00:00
|
|
|
with:
|
|
|
|
command: clippy
|
|
|
|
args: --all-targets -- -D warnings
|