-
Notifications
You must be signed in to change notification settings - Fork 5
Add CI and benchmarks #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
2a0aac3
add inital CI with lint, typecheck, and test jobs
d3b356b
add timeouts for runaway tests
dc8e5fd
benchmarking
e423c4c
add --locked so CI fails on lockfile drift
dff0926
ci done with pinned nightly
0525d95
split CI into lint, test, and typecheck workflows
091adf2
fix borsh import in pack-orders bench
f0dac87
gate borsh import on bench-program-B not borsh-derive
e604f95
Merge remote-tracking branch 'origin/main' into ci-setup
e586fd4
apply rustfmt fixups after merging main
5f0cd7e
install cargo-expand for instruction-macros tests
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| name: Benchmarks | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "Cargo.toml" | ||
| - "Cargo.lock" | ||
| - "rust-toolchain.toml" | ||
| - "program/**" | ||
| - "cu-bench/**" | ||
| - "client/**" | ||
| - "interface/**" | ||
| - "instruction-macros/**" | ||
| - "price/**" | ||
| - "services/**" | ||
| - "transaction-parser/**" | ||
| - ".github/workflows/bench.yml" | ||
| push: | ||
| branches: [main] | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| SOLANA_VERSION: v3.1.9 | ||
|
|
||
| jobs: | ||
| bench: | ||
| name: CU Benchmarks | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 45 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 10.30.3 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: .nvmrc | ||
| cache: pnpm | ||
| - uses: dtolnay/rust-toolchain@1.86.0 | ||
| - uses: Swatinem/rust-cache@v2 | ||
| - run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Cache Solana toolchain | ||
| id: solana-cache | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.local/share/solana/install | ||
| ~/.cache/solana | ||
| key: solana-${{ env.SOLANA_VERSION }}-${{ runner.os }} | ||
|
|
||
| - name: Install Solana CLI | ||
| if: steps.solana-cache.outputs.cache-hit != 'true' | ||
| run: sh -c "$(curl -sSfL https://release.anza.xyz/${SOLANA_VERSION}/install)" | ||
|
|
||
| - name: Add Solana to PATH | ||
| run: echo "$HOME/.local/share/solana/install/active_release/bin" >> "$GITHUB_PATH" | ||
|
|
||
| - run: solana --version | ||
|
|
||
| - name: Bench dropset | ||
| run: pnpm bench:dropset | ||
| - name: Bench manifest | ||
| run: pnpm bench:manifest | ||
| - name: Bench phoenix | ||
| run: pnpm bench:phoenix | ||
| - name: Bench pack-orders | ||
| run: pnpm bench:pack-orders | ||
| - name: Bench to-order-info | ||
| run: pnpm bench:to-order-info |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: [main] | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| RUSTFLAGS: -D warnings | ||
|
|
||
| jobs: | ||
| lint-ts: | ||
| name: Lint (TS / Biome) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 10.30.3 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: .nvmrc | ||
| cache: pnpm | ||
| - run: pnpm install --frozen-lockfile | ||
| - run: pnpm lint:ts | ||
|
|
||
| lint-rust: | ||
| name: Lint (Rust / clippy + rustfmt) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 25 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: dtolnay/rust-toolchain@master | ||
| with: | ||
| toolchain: nightly-2026-04-15 | ||
| components: clippy, rustfmt | ||
| - uses: Swatinem/rust-cache@v2 | ||
| - name: cargo +nightly fmt --check | ||
| run: cargo +nightly fmt --all -- --check | ||
| - name: cargo +nightly clippy -D warnings | ||
| run: cargo +nightly clippy --workspace --all-targets --locked -- -D warnings | ||
|
|
||
| typecheck-ts: | ||
| name: Typecheck (TS) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 10.30.3 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: .nvmrc | ||
| cache: pnpm | ||
| - run: pnpm install --frozen-lockfile | ||
| - run: pnpm check:ts | ||
| - run: pnpm check:ts:test | ||
|
|
||
| check-rust: | ||
| name: Check (Rust) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 20 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: dtolnay/rust-toolchain@1.86.0 | ||
| - uses: Swatinem/rust-cache@v2 | ||
| - run: cargo check --workspace --all-targets --locked | ||
|
|
||
| test-ts: | ||
| name: Test (TS) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 10.30.3 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: .nvmrc | ||
| cache: pnpm | ||
| - run: pnpm install --frozen-lockfile | ||
| - run: pnpm test:ts | ||
|
|
||
| test-rust: | ||
| name: Test (Rust) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: dtolnay/rust-toolchain@1.86.0 | ||
| - uses: Swatinem/rust-cache@v2 | ||
|
ethanterrero marked this conversation as resolved.
Outdated
|
||
| # cu-bench-* tests load pre-built .so files via mollusk; they run in the | ||
| # bench workflow with the Solana toolchain installed. | ||
| - run: > | ||
| cargo test --workspace --locked | ||
| --exclude cu-bench-dropset | ||
| --exclude cu-bench-tests | ||
| --exclude cu-bench-pack-orders | ||
| --exclude cu-bench-to-order-info | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.