Add testnet program ID support for tip-distribution #626
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: Build | |
| on: | |
| push: | |
| branches: | |
| - master | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| branches: | |
| - master | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| security_audit: | |
| name: security_audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install yarn dependencies | |
| working-directory: ./mev-programs | |
| run: yarn | |
| - name: Install latest stable | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: nightly-2025-04-01-x86_64-unknown-linux-gnu | |
| components: rustfmt, clippy | |
| - name: clippy | |
| working-directory: ./mev-programs | |
| run: cargo +nightly-2025-04-01 clippy | |
| shell: bash | |
| - name: Install cargo-audit from crates.io | |
| uses: baptiste0928/cargo-install@v3 | |
| with: | |
| crate: cargo-audit | |
| version: "0.21.2" | |
| - run: cargo audit --ignore RUSTSEC-2022-0093 --ignore RUSTSEC-2024-0344 --ignore RUSTSEC-2024-0421 --ignore RUSTSEC-2025-0022 | |
| working-directory: ./mev-programs | |
| lint: | |
| name: lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| cache-workspaces: | |
| ./mev-programs/ | |
| components: rustfmt, clippy | |
| toolchain: nightly-2024-11-22 | |
| - name: Install cargo-sort from crates.io | |
| uses: baptiste0928/cargo-install@v3 | |
| with: | |
| crate: cargo-sort | |
| - run: cargo sort --workspace --check | |
| working-directory: ./mev-programs | |
| - run: cargo fmt --all --check | |
| working-directory: ./mev-programs | |
| - run: cargo clippy --all-features -- -D warnings -D clippy::all -D clippy::integer_division -D clippy::arithmetic_side_effects -D clippy::style -D clippy::perf | |
| working-directory: ./mev-programs | |
| build: | |
| name: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| cache-workspaces: | |
| ./mev-programs/ | |
| - name: install solana toolsuite | |
| run: sh -c "$(curl -sSfL https://release.anza.xyz/v2.2.13/install)" | |
| - name: add to path | |
| run: echo "/home/runner/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH | |
| - name: Install anchor | |
| uses: baptiste0928/cargo-install@v3 | |
| with: | |
| crate: anchor-cli | |
| git: https://github.com/coral-xyz/anchor | |
| tag: v0.31.1 | |
| - name: Install cargo-nextest | |
| uses: baptiste0928/cargo-install@v3 | |
| with: | |
| crate: cargo-nextest | |
| version: 0.9.94 | |
| - name: Install yarn dependencies | |
| working-directory: ./mev-programs | |
| run: yarn | |
| - name: Build jito_tip_distribution | |
| working-directory: ./mev-programs | |
| run: RUSTUP_TOOLCHAIN=nightly-2025-04-16 anchor build --idl idl --program-name jito_tip_distribution -- --features jito-tip-distribution/mainnet | |
| - name: Build jito_tip_payment | |
| working-directory: ./mev-programs | |
| run: RUSTUP_TOOLCHAIN=nightly-2025-04-16 anchor build --idl idl --program-name jito_tip_payment | |
| - name: Build jito_priority_fee_distribution | |
| working-directory: ./mev-programs | |
| run: RUSTUP_TOOLCHAIN=nightly-2025-04-16 anchor build --idl idl --program-name jito_priority_fee_distribution | |
| # Make sure no uncommitted changes | |
| - name: Check for diff | |
| run: git diff --exit-code | |
| - name: Run cargo test | |
| working-directory: ./mev-programs | |
| run: SBF_OUT_DIR=$(pwd)/target/deploy cargo nextest run | |
| # Slow anchor tests | |
| - run: solana-keygen new --no-bip39-passphrase # needed for tests | |
| - name: Copy IDLs for tests | |
| working-directory: ./mev-programs | |
| run: | | |
| mkdir -p target/idl target/types | |
| cp programs/tip-distribution/idl/*.json target/idl/ | |
| cp programs/tip-payment/idl/*.json target/idl/ | |
| cp programs/priority-fee-distribution/idl/*.json target/idl/ | |
| - name: Run Anchor test | |
| working-directory: ./mev-programs | |
| run: RUSTUP_TOOLCHAIN=nightly-2025-04-16 anchor test --skip-build | |
| verified_build: | |
| name: verified_build | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - run: docker pull --platform linux/amd64 solanafoundation/solana-verifiable-build:2.2.13 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| cache-workspaces: | |
| ./mev-programs/ | |
| - name: Install Solana Verify | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y libudev-dev | |
| rustup install nightly-2025-11-01 | |
| RUSTUP_TOOLCHAIN=nightly-2025-11-01 cargo install solana-verify@0.4.11 | |
| solana-verify --version | |
| - name: Verifiable Build | |
| working-directory: ./mev-programs | |
| run: | | |
| solana-verify build --library-name jito_tip_distribution --base-image solanafoundation/solana-verifiable-build:2.2.13 -- --features jito-tip-distribution/mainnet | |
| sudo mv target/deploy/jito_tip_distribution.so target/deploy/jito_tip_distribution-mainnet.so | |
| solana-verify build --library-name jito_tip_payment --base-image solanafoundation/solana-verifiable-build:2.2.13 | |
| solana-verify build --library-name jito_priority_fee_distribution --base-image solanafoundation/solana-verifiable-build:2.2.13 | |
| solana-verify build --library-name jito_tip_distribution --base-image solanafoundation/solana-verifiable-build:2.2.13 | |
| sudo mv target/deploy/jito_tip_distribution.so target/deploy/jito_tip_distribution-testnet.so | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build | |
| path: | | |
| mev-programs/target/deploy/jito_tip_distribution-mainnet.so | |
| mev-programs/target/deploy/jito_tip_distribution-testnet.so | |
| mev-programs/target/deploy/jito_tip_payment.so | |
| mev-programs/target/deploy/jito_priority_fee_distribution.so | |
| mev-programs/programs/tip-distribution/idl/jito_tip_distribution.json | |
| mev-programs/programs/tip-payment/idl/jito_tip_payment.json | |
| mev-programs/programs/priority-fee-distribution/idl/jito_priority_fee_distribution.json | |
| - name: Cleanup rust cache un-cacheable files | |
| run: | | |
| sudo rm -f ./mev-programs/target/deploy/jito_tip_distribution-keypair.json | |
| sudo rm -f ./mev-programs/target/deploy/jito_tip_payment-keypair.json | |
| - name: Release | |
| uses: softprops/action-gh-release@v1 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| files: | | |
| mev-programs/target/deploy/jito_tip_distribution-mainnet.so | |
| mev-programs/target/deploy/jito_tip_distribution-testnet.so | |
| mev-programs/target/deploy/jito_tip_payment.so | |
| mev-programs/target/deploy/jito_priority_fee_distribution.so | |
| mev-programs/target/idl/jito_tip_distribution.json | |
| mev-programs/target/idl/jito_tip_payment.json | |
| mev-programs/target/idl/jito_priority_fee_distribution.json | |
| # Push to anchor repository | |
| - name: Install anchor for publishing | |
| uses: baptiste0928/cargo-install@v3 | |
| with: | |
| crate: anchor-cli | |
| git: https://github.com/coral-xyz/anchor | |
| tag: v0.31.1 | |
| - name: Anchor Login | |
| if: startsWith(github.ref, 'refs/tags/') | |
| working-directory: ./mev-programs | |
| run: anchor login ${{ secrets.ANCHOR_PUBLISH_TOKEN }} | |
| - name: Publish tip-payment source code | |
| if: startsWith(github.ref, 'refs/tags/') | |
| working-directory: ./mev-programs | |
| run: yes 'yes' | anchor publish jito_tip_payment --skip-build --provider.cluster mainnet | |
| - name: Publish tip-distribution source code | |
| if: startsWith(github.ref, 'refs/tags/') | |
| working-directory: ./mev-programs | |
| run: yes 'yes' | anchor publish jito_tip_distribution --skip-build --provider.cluster mainnet | |
| - name: Publish priority-fee-distribution source code | |
| if: startsWith(github.ref, 'refs/tags/') | |
| working-directory: ./mev-programs | |
| run: yes 'yes' | anchor publish jito_priority_fee_distribution --skip-build --provider.cluster mainnet |