-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
70 additions
and
15 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,77 @@ | ||
name: Rust | ||
on: [push, pull_request] | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
name: Nightly lints | ||
|
||
jobs: | ||
build: | ||
clippy: | ||
name: Clippy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install nightly toolchain with clippy available | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly | ||
override: true | ||
components: clippy | ||
|
||
- name: Run cargo clippy | ||
uses: actions-rs/cargo@v1 | ||
continue-on-error: true # WARNING: only for this example, remove it! | ||
with: | ||
command: clippy | ||
args: -- -D warnings | ||
|
||
rustfmt: | ||
name: Format | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install nightly toolchain with rustfmt available | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly | ||
override: true | ||
components: rustfmt | ||
|
||
- name: Run cargo fmt | ||
uses: actions-rs/cargo@v1 | ||
continue-on-error: true # WARNING: only for this example, remove it! | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
|
||
combo: | ||
name: Clippy + rustfmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build | ||
run: cargo build --verbose | ||
- name: Run tests | ||
run: cargo test --verbose | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install nightly toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly | ||
override: true | ||
components: rustfmt, clippy | ||
|
||
- name: Run cargo fmt | ||
uses: actions-rs/cargo@v1 | ||
continue-on-error: true # WARNING: only for this example, remove it! | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
|
||
- name: Run cargo clippy | ||
uses: actions-rs/cargo@v1 | ||
continue-on-error: true # WARNING: only for this example, remove it! | ||
with: | ||
command: clippy | ||
args: -- -D warnings |