release: v0.2.0 #50
Workflow file for this run
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: Magic Router Build | |
| on: | |
| pull_request: | |
| branches: [ "master" ] | |
| env: | |
| solana_version: v2.2.1 | |
| jobs: | |
| install: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: rust:1.89.0 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/cache@v4 | |
| name: cache solana cli | |
| id: cache-solana | |
| with: | |
| path: | | |
| ~/.cache/solana/ | |
| ~/.local/share/solana/ | |
| key: solana-${{ runner.os }}-v0000-${{ env.solana_version }} | |
| - name: install solana | |
| if: steps.cache-solana.outputs.cache-hit != 'true' | |
| run: | | |
| sh -c "$(curl -sSfL https://release.anza.xyz/${{ env.solana_version }}/install)" | |
| export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH" | |
| solana --version | |
| rust-checks: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: rust:1.89.0 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Install rustfmt and clippy | |
| run: rustup component add rustfmt clippy | |
| - name: Run rustfmt | |
| run: cargo fmt --check | |
| - name: Run clippy | |
| run: cargo clippy -- -D warnings | |
| test-and-build: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: rust:latest | |
| needs: | |
| - rust-checks | |
| - install | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - uses: actions/cache@v4 | |
| name: cache solana cli | |
| id: cache-solana | |
| with: | |
| path: | | |
| ~/.cache/solana/ | |
| ~/.local/share/solana/ | |
| key: solana-${{ runner.os }}-v0000-${{ env.solana_version }} | |
| - name: Install protoc (protobuf-compiler) | |
| run: | | |
| apt-get update | |
| apt-get install -y protobuf-compiler | |
| - name: Build shared object | |
| run: | | |
| export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH" | |
| cargo build-sbf -- -Znext-lockfile-bump | |
| - name: Run tests | |
| run: cargo test |