-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
solana: add basic CI for Solana integration branch
- Loading branch information
Showing
1 changed file
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: Solana Integration Checks | ||
on: | ||
push: | ||
branches: | ||
- solana/integration | ||
pull_request: null | ||
|
||
env: | ||
RUSTC_VERSION: 1.76.0 | ||
jobs: | ||
cancel-previous-runs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
cargo-clippy-and-lint: | ||
name: Clippy Checks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install toolchain | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ env.RUSTC_VERSION }} | ||
components: clippy, rustfmt | ||
- name: cargo fmt --check | ||
run: cargo fmt --check | ||
working-directory: ./solana | ||
- name: cargo clippy --locked --no-deps --all-targets --features testnet -- -D warnings | ||
run: cargo clippy --locked --no-deps --all-targets --features testnet -- -D warnings | ||
working-directory: ./solana | ||
- name: cargo clippy --locked --no-deps --all-targets --features localnet -- -D warnings | ||
run: cargo clippy --locked --no-deps --all-targets --features localnet -- -D warnings | ||
working-directory: ./solana | ||
test: | ||
name: Run Tests | ||
runs-on: ubuntu-latest | ||
# Anchor Docker image: https://www.anchor-lang.com/docs/verifiable-builds#images | ||
container: backpackapp/build:v0.29.0 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install NPM dependencies | ||
run: npm ci | ||
working-directory: ./solana | ||
- name: Set default Rust toolchain | ||
run: rustup default stable | ||
working-directory: ./solana | ||
- name: cargo test --features localnet --no-default-features | ||
run: cargo test --features localnet --no-default-features | ||
working-directory: ./solana | ||
- name: cargo test --features testnet --no-default-features | ||
run: cargo test --features testnet --no-default-features | ||
working-directory: ./solana | ||
- name: anchor build --arch sbf -- --features testnet | ||
run: anchor build --arch sbf -- --features testnet | ||
working-directory: ./solana | ||
- name: Create artifact directory | ||
run: mkdir -p ts/tests/artifacts | ||
working-directory: ./solana | ||
- name: Copy Testnet Matching Engine Object | ||
run: cp target/deploy/matching_engine.so ts/tests/artifacts/testnet_matching_engine.so | ||
working-directory: ./solana | ||
- name: Copy Testnet Token Router Object | ||
run: cp target/deploy/token_router.so ts/tests/artifacts/testnet_token_router.so | ||
working-directory: ./solana | ||
- name: Copy Upgrade Manager Object | ||
run: cp target/deploy/upgrade_manager.so ts/tests/artifacts/testnet_upgrade_manager.so | ||
working-directory: ./solana | ||
- name: anchor build --arch sbf -- --features integration-test | ||
run: anchor build --arch sbf -- --features integration-test | ||
working-directory: ./solana | ||
- name: anchor test --skip-build | ||
run: anchor test --skip-build | ||
working-directory: ./solana |