Skip to content

Commit 992fc8a

Browse files
committed
solana: add basic CI for Solana integration branch
1 parent f1a5568 commit 992fc8a

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

.github/workflows/ci.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Solana Integration Checks
2+
on:
3+
push:
4+
branches:
5+
- solana/integration
6+
pull_request: null
7+
8+
env:
9+
RUSTC_VERSION: 1.76.0
10+
jobs:
11+
cancel-previous-runs:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Cancel Previous Runs
15+
uses: styfle/cancel-workflow-action@0.9.1
16+
with:
17+
access_token: ${{ github.token }}
18+
cargo-clippy-and-lint:
19+
name: Clippy Checks
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Install toolchain
24+
uses: dtolnay/rust-toolchain@master
25+
with:
26+
toolchain: ${{ env.RUSTC_VERSION }}
27+
components: clippy, rustfmt
28+
- name: Switch to Solana directory
29+
run: cd solana
30+
- name: cargo fmt --check
31+
run: cargo fmt --check
32+
- name: cargo clippy --locked --no-deps --all-targets --features testnet -- -D warnings
33+
run: cargo clippy --locked --no-deps --all-targets --features testnet -- -D warnings
34+
- name: cargo clippy --locked --no-deps --all-targets --features localnet -- -D warnings
35+
run: cargo clippy --locked --no-deps --all-targets --features localnet -- -D warnings
36+
test:
37+
name: Run Tests
38+
runs-on: ubuntu-latest
39+
# Anchor Docker image: https://www.anchor-lang.com/docs/verifiable-builds#images
40+
container: backpackapp/build:v0.29.0
41+
steps:
42+
- uses: actions/checkout@v4
43+
- name: Switch to Solana directory
44+
run: cd solana
45+
- name: Generate new keygen
46+
run: solana-keygen new
47+
- name: Install NPM dependencies
48+
run: npm ci
49+
- name: cargo test --features localnet --no-default-features
50+
run: cargo test --features localnet --no-default-features
51+
- name: cargo test --features testnet --no-default-features
52+
run: cargo test --features testnet --no-default-features
53+
- name: anchor build --arch sbf -- --features testnet
54+
run: anchor build --arch sbf -- --features testnet
55+
- name: Create artifact directory
56+
run: mkdir -p ts/tests/artifacts
57+
- name: Copy Testnet Matching Engine Object
58+
run: cp target/deploy/matching_engine.so ts/tests/artifacts/testnet_matching_engine.so
59+
- name: Copy Testnet Token Router Object
60+
run: cp target/deploy/token_router.so ts/tests/artifacts/testnet_token_router.so
61+
- name: Copy Upgrade Manager Object
62+
run: cp target/deploy/upgrade_manager.so ts/tests/artifacts/testnet_upgrade_manager.so
63+
- name: anchor build --arch sbf -- --features integration-test
64+
run: anchor build --arch sbf -- --features integration-test
65+
- name: anchor test --skip-build
66+
run: anchor test --skip-build

0 commit comments

Comments
 (0)