Fea/updating deps (#3) #14
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: Main | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
env: | |
RUST_VERSION: nightly # 1.78.0 | |
SOLANA_VERSION: 2.10.0 | |
CARGO_CACHE: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v4 | |
- name: Install components | |
uses: dtolnay/rust-toolchain@master | |
with: | |
components: clippy, rustfmt | |
toolchain: ${{ env.RUST_VERSION }} | |
- name: Formatting | |
run: cargo fmt --all --check | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v3 | |
- name: Clippy | |
run: cargo clippy --all-targets --all-features --no-deps | |
build_test: | |
name: Build | |
needs: lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
key: cargo-build-sbf-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
cargo-build-sbf- | |
- name: Install Solana using metaplex action | |
uses: metaplex-foundation/actions/install-solana@v1 | |
with: | |
cache: true | |
version: ${{ env.SOLANA_VERSION }} | |
- name: Build cargo | |
run: cargo build-bpf | |
- name: Test workspace | |
run: cargo test-bpf | |