-
Notifications
You must be signed in to change notification settings - Fork 1
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
48aa40c
commit 0c0dc49
Showing
1 changed file
with
70 additions
and
14 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,27 +1,83 @@ | ||
name: Rust CI/CD | ||
|
||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
|
||
|
||
tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
|
||
- name: version info | ||
run: rustc --version; cargo --version; | ||
|
||
- name: Run all tests | ||
run: cargo test | ||
|
||
- name: Run all tests (no default features) | ||
run: cargo test --no-default-features | ||
|
||
|
||
fmt: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
|
||
- name: Set up Rust | ||
uses: actions/setup-rust@v1 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Format Code | ||
run: cargo fmt --all -- --check | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
|
||
- name: Build Anchor | ||
run: anchor build | ||
|
||
- name: Check Clippy | ||
run: cargo clippy --all -- --deny warnings | ||
clippy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
|
||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
args: -- -D warnings | ||
|
||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
|
||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: build |