use a makefile (#120) #383
This file contains hidden or 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, agave-2.2.0, agave-2.3.0] | |
| pull_request: | |
| branches: [main, agave-2.2.0, agave-2.3.0] | |
| env: {} | |
| jobs: | |
| rust_fmt: | |
| name: Rustfmt | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Get nightly toolchain version | |
| id: nightly | |
| run: echo "version=$(make nightly-version)" >> $GITHUB_OUTPUT | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ steps.nightly.outputs.version }} | |
| components: rustfmt | |
| - name: Run format | |
| run: make format-check | |
| rust_clippy: | |
| name: Clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| key: cargo-clippy-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| cargo-clippy- | |
| - name: Get nightly toolchain version | |
| id: nightly | |
| run: echo "version=$(make nightly-version)" >> $GITHUB_OUTPUT | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ steps.nightly.outputs.version }} | |
| components: clippy | |
| - name: Run clippy | |
| run: make clippy | |
| cargo_build_test: | |
| name: Cargo Build and Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - 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: Get Solana version | |
| id: solana | |
| run: echo "version=$(make solana-version)" >> $GITHUB_OUTPUT | |
| - uses: metaplex-foundation/actions/install-solana@v1 | |
| with: | |
| cache: true | |
| version: ${{ steps.solana.outputs.version }} | |
| - name: Build test programs | |
| run: make build-test-programs | |
| - name: Test | |
| run: make test | |
| audit_rust: | |
| name: Audit Rust | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| key: cargo-audit-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| cargo-audit- | |
| - uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-audit | |
| - name: Run cargo-audit | |
| run: make audit |