Add github actions #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check and Lint | |
on: | |
push: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rust: | |
- stable | |
steps: | |
# Checkout repository | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
# Setup Rust | |
- name: Setup Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.rust }} | |
override: true | |
# Cargo check | |
- name: Run cargo check | |
run: cargo check --all-targets | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rust: | |
- stable | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.rust }} | |
override: true | |
- run: rustup component add clippy | |
- run: cargo clippy --all-targets -- -D warnings |