ci: inline Solana CLI install, pin to v2.1.14 #9
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| fmt: | |
| name: Format | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - run: cargo fmt --check | |
| clippy: | |
| name: Clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-clippy-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: ${{ runner.os }}-clippy- | |
| - run: cargo clippy --all-targets -- -D warnings -D clippy::unwrap_used | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - run: sudo apt-get update && sudo apt-get install -y pkg-config build-essential libudev-dev | |
| - uses: actions/cache@v4 | |
| id: cache-solana | |
| with: | |
| path: | | |
| ~/.cache/solana | |
| ~/.local/share/solana | |
| key: solana-${{ runner.os }}-v0001-stable | |
| - name: Install Solana CLI | |
| if: steps.cache-solana.outputs.cache-hit != 'true' | |
| run: sh -c "$(curl -sSfL https://release.anza.xyz/v2.1.14/install)" | |
| - name: Set Solana path | |
| run: echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH | |
| - name: Create default keypair | |
| run: solana-keygen new -s --no-bip39-passphrase --force | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-test-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: ${{ runner.os }}-test- | |
| - run: cargo build-sbf | |
| - run: cargo test |