-
Notifications
You must be signed in to change notification settings - Fork 16
100 lines (91 loc) · 3.1 KB
/
build.yaml
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
name: Build
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
SOLANA_CLI_VERSION: 1.16.14
jobs:
build-and-test:
name: Build and test programs
runs-on: big-runner-1
steps:
# Setup
- uses: actions/checkout@v2
- uses: ./.github/actions/setup/
- uses: ./.github/actions/setup-solana/
- uses: actions/cache@v2
name: Cache Cargo registry + index
id: cache-anchor
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
./mev-programs/target/
key: cargo-${{ runner.os }}-anchor-${{ hashFiles('**/Cargo.lock') }}
- run: cargo install --git https://github.com/coral-xyz/anchor --tag v0.27.0 anchor-cli --locked --force
- name: Install yarn dependencies
working-directory: ./mev-programs
run: yarn
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2023-04-19-x86_64-unknown-linux-gnu
components: rustfmt, clippy
- name: clippy
run: cargo +nightly-2023-04-19 clippy --all-features --all-targets --tests -- -D warnings
shell: bash
# Build IDLs
- name: Build jito_tip_distribution
working-directory: ./mev-programs
run: anchor build --idl idl --program-name jito_tip_distribution
- name: Build jito_tip_payment
working-directory: ./mev-programs
run: anchor build --idl idl --program-name jito_tip_payment
# Test
- name: Run Anchor test
working-directory: ./mev-programs
run: anchor test
# Make sure no uncommitted changes
- name: Check for diff
run: git diff --exit-code
verified-build:
name: Build Verifiable Artifact
runs-on: big-runner-1
steps:
- name: Checkout
uses: actions/checkout@v3
# --force because the cargo cache has it saved
- name: Install Solana Verify
run: |
cargo install solana-verify --force
solana-verify --version
- name: Verifiable Build
working-directory: ./mev-programs
run: |
solana-verify build --library-name jito_tip_distribution
solana-verify build --library-name jito_tip_payment
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: build
path: |
mev-programs/target/deploy/jito_tip_distribution.so
mev-programs/target/deploy/jito_tip_payment.so
mev-programs/target/idl/jito_tip_distribution.json
mev-programs/target/idl/jito_tip_payment.json
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
working-directory: ./mev-programs
files: |
mev-programs/target/deploy/jito_tip_distribution.so
mev-programs/target/deploy/jito_tip_payment.so
mev-programs/target/idl/jito_tip_distribution.json
mev-programs/target/idl/jito_tip_payment.json