-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
c286255
commit 9e577fa
Showing
2 changed files
with
77 additions
and
6 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 |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: ci | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
rustfmt: | ||
name: Check rustfmt | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/main' | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- run: cargo fmt --all -- --check | ||
|
||
test: | ||
name: Run linter | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/main' | ||
env: | ||
RUSTFLAGS: -D warnings | ||
RUSTDOCFLAGS: -D warnings | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- uses: hecrj/setup-rust-action@v1 | ||
with: | ||
components: clippy | ||
- name: Cache cargo directories | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} | ||
${{ runner.os }}-cargo- | ||
- name: Cache cargo target dirs | ||
uses: actions/cache@v2 | ||
with: | ||
path: target | ||
key: ${{ runner.os }}-target-lint-stable-${{ hashFiles('**/Cargo.toml') }} | ||
restore-keys: | | ||
${{ runner.os }}-target-lint-stable-${{ hashFiles('**/Cargo.toml') }} | ||
${{ runner.os }}-target-lint-stable- | ||
${{ runner.os }}-target-lint- | ||
- name: all features | ||
run: cargo clippy | ||
|
||
- name: no features | ||
run: cargo clippy --no-default-features | ||
|
||
- name: examples, all features | ||
run: cargo clippy --examples | ||
|
||
- name: examples, no features | ||
run: cargo clippy --examples --no-default-features | ||
|
||
- name: tests | ||
run: cargo clippy --examples --no-default-features | ||
|
||
- name: examples, all features | ||
run: cargo test | ||
|
||
- name: examples, no features | ||
run: cargo test --no-default-features |
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