Update README #2
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: "Rust CI" | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
fmt: | |
name: "Cargo format" | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: "Checkout repository" | |
uses: "actions/checkout@v3" | |
- name: "Install stable toolchain" | |
uses: "actions-rs/toolchain@v1" | |
with: | |
profile: "minimal" | |
toolchain: "stable" | |
override: true | |
- name: "Install cargo fmt" | |
run: "rustup component add rustfmt" | |
- name: "Run cargo fmt" | |
uses: "actions-rs/cargo@v1" | |
with: | |
command: "fmt" | |
args: "--all -- --check" | |
clippy: | |
name: "Cargo clippy" | |
needs: [fmt] | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: "Checkout repository" | |
uses: "actions/checkout@v3" | |
- name: "Install stable toolchain" | |
uses: "actions-rs/toolchain@v1" | |
with: | |
profile: "minimal" | |
toolchain: "stable" | |
override: true | |
- name: "Install cargo clippy" | |
run: "rustup component add clippy" | |
- name: "Run cargo clippy" | |
uses: "actions-rs/cargo@v1" | |
with: | |
command: "clippy" | |
args: "-- -D warnings" | |
build: | |
name: "Cargo build" | |
needs: [clippy] | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: "Checkout repository" | |
uses: "actions/checkout@v3" | |
- name: "Install stable toolchain" | |
uses: "actions-rs/toolchain@v1" | |
with: | |
profile: "minimal" | |
toolchain: "stable" | |
override: true | |
- name: "Run cargo build" | |
uses: "actions-rs/cargo@v1" | |
with: | |
command: "build" | |
args: "--all --release" |