-
Notifications
You must be signed in to change notification settings - Fork 34
190 lines (177 loc) · 7.18 KB
/
Copy pathbuild.yaml
File metadata and controls
190 lines (177 loc) · 7.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
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
# Build
- 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
- 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: Run Anchor test
working-directory: ./mev-programs
run: RUSTUP_TOOLCHAIN=nightly-2025-04-16 anchor test
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: |
RUSTUP_TOOLCHAIN=nightly-2025-04-01 cargo install solana-verify@0.4.3
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
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
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: build
path: |
mev-programs/target/deploy/jito_tip_distribution.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 ./mev-programs/target/deploy/jito_tip_distribution-keypair.json
sudo rm ./mev-programs/target/deploy/jito_tip_payment-keypair.json
# Tag related steps
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
mev-programs/target/deploy/jito_tip_distribution.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: 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