-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add proper CI * fmt * badge * bump edition * working badge for crates.io
- Loading branch information
1 parent
819ff76
commit 5162dbe
Showing
4 changed files
with
97 additions
and
17 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,102 @@ | ||
name: Rust | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
branches: | ||
- master | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
test: | ||
name: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/cancel-workflow-action@0.9.1 | ||
with: | ||
access_token: ${{ github.token }} | ||
- name: Checkout Sources | ||
uses: actions/checkout@v3 | ||
- name: Install Toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
- name: Rust Cache | ||
uses: Swatinem/rust-cache@v1.4.0 | ||
- name: Run tests | ||
run: cargo test --verbose | ||
|
||
|
||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/cancel-workflow-action@0.9.1 | ||
with: | ||
access_token: ${{ github.token }} | ||
- name: Checkout Sources | ||
uses: actions/checkout@v3 | ||
- name: Install Toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
- name: Install Clippy | ||
run: rustup component add clippy | ||
- name: Install RustFmt | ||
run: rustup component add rustfmt | ||
- name: Rust Cache | ||
uses: Swatinem/rust-cache@v1.4.0 | ||
- name: Run format check | ||
run: cargo fmt --all --check | ||
- name: Run clippy | ||
run: cargo clippy --all --all-targets -- -D warnings | ||
|
||
audit: | ||
name: Audit | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Sources | ||
uses: actions/checkout@v2 | ||
- name: Install Toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
- name: Install Audit | ||
run: cargo install cargo-audit | ||
- name: Rust Cache | ||
uses: Swatinem/rust-cache@v1.4.0 | ||
- name: Run Audit | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: audit | ||
|
||
build: | ||
name: Build | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
rv: [stable, beta, nightly] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build | ||
run: cargo build --verbose | ||
- name: Run tests | ||
run: cargo test --verbose | ||
- name: Cancel Previous Runs | ||
uses: styfle/cancel-workflow-action@0.9.1 | ||
with: | ||
access_token: ${{ github.token }} | ||
- name: Checkout Sources | ||
uses: actions/checkout@v2 | ||
- name: Install Toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ matrix.rv }} | ||
- name: Rust Cache | ||
uses: Swatinem/rust-cache@v1.4.0 | ||
- name: Cargo Build | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build |
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
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
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