Merge pull request #1 from sunrise-stake/update/anchor-v0.28 #4
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 | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
env: | |
CARGO_TERM_COLOR: always | |
RUST_TOOLCHAIN: "1.71.0" | |
jobs: | |
lint: | |
name: Clippy/Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
override: true | |
profile: minimal | |
toolchain: ${{ env.RUST_TOOLCHAIN }} | |
components: rustfmt, clippy | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo fmt -- --check | |
- run: cargo clippy --all-targets -- --deny=warnings | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust nightly | |
uses: actions-rs/toolchain@v1 | |
with: | |
override: true | |
profile: minimal | |
toolchain: ${{ env.RUST_TOOLCHAIN }} | |
components: rustfmt, clippy | |
- name: Cache dependencies | |
uses: Swatinem/rust-cache@v2 | |
- run: cargo check | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust nightly | |
uses: actions-rs/toolchain@v1 | |
with: | |
override: true | |
profile: minimal | |
toolchain: ${{ env.RUST_TOOLCHAIN }} | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo build --all-targets | |
test: | |
name: Unit Tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust nightly | |
uses: actions-rs/toolchain@v1 | |
with: | |
override: true | |
profile: minimal | |
toolchain: ${{ env.RUST_TOOLCHAIN }} | |
components: rustfmt, clippy | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo test | |
doc: | |
name: Documentation | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust nightly | |
uses: actions-rs/toolchain@v1 | |
with: | |
override: true | |
profile: minimal | |
toolchain: ${{ env.RUST_TOOLCHAIN }} | |
components: rustfmt, clippy | |
- name: Cache dependencies | |
uses: Swatinem/rust-cache@v2 | |
- run: cargo doc |