feat: JIP-27 Implementation #1213
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: Build | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - steward-test-branch | |
| - feat/directed-staking | |
| - ak/directed-staking-offchain | |
| tags: | |
| - "v*" | |
| pull_request: | |
| branches: | |
| - master | |
| - steward-test-branch | |
| - feat/directed-staking | |
| - ak/directed-staking-offchain | |
| jobs: | |
| security_audit: | |
| name: security_audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install cargo-audit from crates.io | |
| uses: baptiste0928/cargo-install@v3 | |
| with: | |
| crate: cargo-audit | |
| version: "0.21.1" | |
| - run: cargo audit --ignore RUSTSEC-2022-0093 --ignore RUSTSEC-2024-0344 --ignore RUSTSEC-2024-0421 --ignore RUSTSEC-2025-0022 --ignore RUSTSEC-2025-0009 --ignore RUSTSEC-2025-0004 --ignore RUSTSEC-2024-0357 --ignore RUSTSEC-2024-0336 --ignore RUSTSEC-2025-0055 | |
| lint: | |
| name: lint | |
| runs-on: big-runner-1 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| components: rustfmt, clippy | |
| toolchain: nightly-2025-02-19 | |
| - name: Install Protobuf Compiler | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y protobuf-compiler libudev-dev libclang-dev | |
| - name: Install cargo-sort from crates.io | |
| uses: baptiste0928/cargo-install@v3 | |
| with: | |
| crate: cargo-sort | |
| version: 1.0.9 | |
| - run: cargo sort --workspace --check | |
| - run: cargo fmt --all --check | |
| - run: cargo +nightly-2025-02-19 clippy --all-features --all-targets --tests -- -D warnings | |
| udeps: | |
| name: udeps | |
| runs-on: big-runner-1 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Protobuf Compiler | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y protobuf-compiler libudev-dev libclang-dev | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: nightly-2025-02-19 | |
| - name: Install cargo-udeps from crates.io | |
| uses: baptiste0928/cargo-install@v3 | |
| with: | |
| crate: cargo-udeps | |
| version: "0.1.57" | |
| - run: cargo +nightly-2025-02-19 udeps --all-features --all-targets --tests | |
| build_release: | |
| name: build_release | |
| runs-on: big-runner-1 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Protobuf Compiler | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y protobuf-compiler libudev-dev libclang-dev | |
| - name: Build release | |
| run: cargo build --release --all-features | |
| verified_build: | |
| name: verified_build | |
| runs-on: big-runner-1 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install solana-verify deps | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y protobuf-compiler libudev-dev libclang-dev | |
| - name: Install solana-verify from crates.io | |
| uses: baptiste0928/cargo-install@v3 | |
| with: | |
| crate: solana-verify | |
| version: "0.4.11" | |
| - name: Install anchor-cli from crates.io | |
| uses: baptiste0928/cargo-install@v3 | |
| with: | |
| crate: anchor-cli | |
| version: "0.32.1" | |
| - name: install solana toolsuite | |
| run: sh -c "$(curl -sSfL https://release.anza.xyz/v3.0.8/install)" | |
| - name: add to path | |
| run: echo "/home/runner/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH | |
| # build the program and IDL; exit if error | |
| - run: RUSTUP_TOOLCHAIN=nightly-2025-08-01 anchor build --idl idl | |
| - name: Check for diff on IDL | |
| run: git diff --exit-code programs/validator-history/idl/validator_history.json programs/steward/idl/steward.json | |
| # run verified build | |
| - run: git checkout $(git rev-parse --abbrev-ref HEAD) -- Cargo.lock | |
| - run: solana-verify build --library-name validator_history | |
| - run: solana-verify build --library-name jito_steward -- --features mainnet-beta | |
| # create build for tests | |
| - run: cargo build-sbf --manifest-path programs/steward/Cargo.toml --sbf-out-dir target/test | |
| # upload the IDL and verified build | |
| - name: Upload validator_history.so | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: validator_history.so | |
| path: target/deploy/validator_history.so | |
| - name: Upload jito_steward.so | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: jito_steward.so | |
| path: target/deploy/jito_steward.so | |
| - name: Upload test jito_steward.so | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: jito_steward_test.so | |
| path: target/test/jito_steward.so | |
| - name: Upload Validator History IDL | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: validator_history.json | |
| path: programs/validator-history/idl/validator_history.json | |
| - name: Upload Jito Steward IDL | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: jito_steward.json | |
| path: programs/steward/idl/steward.json | |
| # tests run on verified build | |
| test: | |
| name: test | |
| runs-on: big-runner-1 | |
| needs: | |
| - verified_build | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Protobuf Compiler | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y protobuf-compiler libudev-dev libclang-dev | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: validator_history.so | |
| path: target/deploy/ | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: jito_steward_test.so | |
| path: target/test/ | |
| - name: Rename test artifact to jito_steward.so | |
| run: mv ./target/test/jito_steward.so ./target/deploy/jito_steward.so | |
| shell: bash | |
| - name: cargo test | |
| run: cargo test --package tests --package stakenet-sdk --all-features --color auto | |
| shell: bash | |
| env: | |
| RUST_LOG: trace | |
| SBF_OUT_DIR: ${{ github.workspace }}/target/deploy | |
| RUST_MIN_STACK: 10000000 | |
| RUSTFLAGS: --cfg anchor_debug | |
| - name: cargo test --doc | |
| run: cargo test --doc --all-features --color auto | |
| shell: bash | |
| env: | |
| RUST_LOG: trace | |
| SBF_OUT_DIR: ${{ github.workspace }}/target/deploy | |
| RUST_MIN_STACK: 10000000 | |
| RUSTFLAGS: --cfg anchor_debug | |
| # release only runs on tagged commits | |
| # it should wait for all the other steps to finish, to ensure releases are the highest quality | |
| # after waiting, it will download the verified build and IDL from the verified_build step and release the artifacts | |
| release: | |
| name: release | |
| runs-on: big-runner-1 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| needs: | |
| - security_audit | |
| - lint | |
| - udeps | |
| - verified_build | |
| - test | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: validator_history.so | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: validator_history.json | |
| - name: release | |
| uses: softprops/action-gh-release@v1 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| files: | | |
| validator_history.so | |
| validator_history.json |