-
Notifications
You must be signed in to change notification settings - Fork 22
add CI/CD workflow #40
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
base: main
Are you sure you want to change the base?
Changes from 6 commits
4152a57
a63c0b7
152af10
76ad695
f9945b7
dd35f14
9cc508b
f64efba
5489da1
487ad34
c91c584
d84f041
01cb458
4d0c0e3
040cfa3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,153 @@ | ||||||||||||||||||||||||||||||||||||||||||
| name: Test Examples | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||||||||||||
| branches: [ main ] | ||||||||||||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||||||||||||
| branches: [ main ] | ||||||||||||||||||||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||
| test-examples: | ||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+10
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Optional: Add Cargo cache to speed builds. Caching target/registry cuts CI time and bandwidth. steps:
- uses: actions/checkout@v4
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||
| - name: Setup Rust | ||||||||||||||||||||||||||||||||||||||||||
| uses: actions-rs/toolchain@v1 | ||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||
| toolchain: '1.82' | ||||||||||||||||||||||||||||||||||||||||||
| override: true | ||||||||||||||||||||||||||||||||||||||||||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
Comment on lines
+17
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replace the deprecated Rust setup action.
🧰 Tools🪛 actionlint (1.7.8)18-18: the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue (action) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+17
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replace the deprecated Rust toolchain action
- - name: Setup Rust
- uses: actions-rs/toolchain@v1
- with:
- toolchain: '1.82'
- override: true
+ - name: Setup Rust
+ uses: dtolnay/rust-toolchain@master
+ with:
+ toolchain: 1.82📝 Committable suggestion
Suggested change
🧰 Tools🪛 actionlint (1.7.7)18-18: the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue (action) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||
| - name: Install Solana | ||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||
| sh -c "$(curl -sSfL https://release.anza.xyz/v2.1.21/install)" | ||||||||||||||||||||||||||||||||||||||||||
| echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| - name: Install Anchor | ||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||
| cargo install --git https://github.com/coral-xyz/anchor avm --locked --force | ||||||||||||||||||||||||||||||||||||||||||
| avm install 0.31.1 | ||||||||||||||||||||||||||||||||||||||||||
| avm use 0.31.1 | ||||||||||||||||||||||||||||||||||||||||||
| echo "$HOME/.avm/bin" >> $GITHUB_PATH | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| - name: Install MagicBlock Ephemeral Validator | ||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||
| npm install -g @magicblock-labs/ephemeral-validator@latest | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+35
to
+38
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Pin Ephemeral Validator npm version for reproducibility Installing @latest is brittle. Pin a known-good version to avoid sudden CI breaks. - npm install -g @magicblock-labs/ephemeral-validator@latest
+ npm install -g @magicblock-labs/ephemeral-validator@<pinned-version>If you share the target version, I can update the diff. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||
| - name: Configure Solana | ||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||
| solana config set --url localhost | ||||||||||||||||||||||||||||||||||||||||||
| solana-keygen new --no-bip39-passphrase --silent --outfile ~/.config/solana/id.json | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| - name: Start Solana Test Validator | ||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||
| solana-test-validator \ | ||||||||||||||||||||||||||||||||||||||||||
| --ledger ./my-ledger-1 \ | ||||||||||||||||||||||||||||||||||||||||||
| --reset \ | ||||||||||||||||||||||||||||||||||||||||||
| --clone mAGicPQYBMvcYveUZA5F5UNNwyHvfYh5xkLS2Fr1mev \ | ||||||||||||||||||||||||||||||||||||||||||
| --clone EpJnX7ueXk7fKojBymqmVuCuwyhDQsYcLVL1XMsBbvDX \ | ||||||||||||||||||||||||||||||||||||||||||
| --clone 7JrkjmZPprHwtuvtuGTXp9hwfGYFAQLnLeFM52kqAgXg \ | ||||||||||||||||||||||||||||||||||||||||||
| --clone noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV \ | ||||||||||||||||||||||||||||||||||||||||||
| --clone-upgradeable-program DELeGGvXpWV2fqJUhqcF5ZSYMS4JTLjteaAMARRSaeSh \ | ||||||||||||||||||||||||||||||||||||||||||
| --clone Cuj97ggrhhidhbu39TijNVqE74xvKJ69gDervRUXAxGh \ | ||||||||||||||||||||||||||||||||||||||||||
| --clone 5hBR571xnXppuCPveTrctfTU7tJLSN94nq7kv7FRK5Tc \ | ||||||||||||||||||||||||||||||||||||||||||
| --clone F72HqCR8nwYsVyeVd38pgKkjXmXFzVAM8rjZZsXWbdE \ | ||||||||||||||||||||||||||||||||||||||||||
| --clone vrfkfM4uoisXZQPrFiS2brY4oMkU9EWjyvmvqaFd5AS \ | ||||||||||||||||||||||||||||||||||||||||||
| --clone-upgradeable-program Vrf1RNUjXmQGjmQrQLvJHs9SNkvDJEsRVFPkfSQUwGz \ | ||||||||||||||||||||||||||||||||||||||||||
| --clone-upgradeable-program BTWAqWNBmF2TboMh3fxMJfgR16xGHYD7Kgr2dPwbRPBi \ | ||||||||||||||||||||||||||||||||||||||||||
| --url https://api.devnet.solana.com & | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| # Wait for validator to be ready | ||||||||||||||||||||||||||||||||||||||||||
| timeout 30 bash -c 'until solana cluster-version --url http://localhost:8899 >/dev/null 2>&1; do sleep 1; done' | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||
| - name: Increase file descriptor limit | ||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||
| ulimit -n 1000000 | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
| - name: Increase file descriptor limit | |
| run: | | |
| ulimit -n 1000000 | |
| # (removed standalone ulimit step; applying ulimit in each validator step) | |
| - name: Start Solana Test Validator | |
| run: | | |
| ulimit -n 1000000 | |
| solana-test-validator \ | |
| --reset \ | |
| --limit-ledger-size \ | |
| # …other flags… | |
| - name: Start MagicBlock Ephemeral Validator | |
| run: | | |
| ulimit -n 1000000 | |
| RUST_LOG=info ephemeral-validator \ | |
| --network localnet \ | |
| # …other flags… |
🤖 Prompt for AI Agents
.github/workflows/test.yml lines 65-68: the workflow currently runs a standalone
step to set ulimit (ulimit -n 1000000), but ulimit is process/step-scoped and
will not persist to later steps; remove this standalone step and instead add the
ulimit command at the start of each step that launches validators or other
long-running processes (i.e., prepend `ulimit -n 1000000` as the first command
in those run blocks) so the increased file descriptor limit applies to the
processes started in those steps.
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop the contradictory --remote-cluster development flag.
You’re pointing ephemeral-validator at the local Solana endpoints while simultaneously declaring the source cluster as development. Those settings conflict and can lead to the validator syncing from the wrong source. Remove --remote-cluster development (or swap the URLs to devnet) so the configuration is coherent.
🤖 Prompt for AI Agents
.github/workflows/test.yml around lines 72 to 77: the ephemeral-validator
invocation includes a contradictory flag --remote-cluster development while
pointing at local URLs; remove the --remote-cluster development flag (or
alternatively replace the local URLs with devnet endpoints) so the command
either targets local endpoints only or consistently targets the development
cluster, ensuring configuration coherence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tighten trigger syntax to satisfy yamllint
yamllintflags the current trigger block (on,[ main ]). Quote the key and drop the extra spaces to clear the errors:🧰 Tools
🪛 YAMLlint (1.37.1)
[warning] 3-3: truthy value should be one of [false, true]
(truthy)
[error] 5-5: too many spaces inside brackets
(brackets)
[error] 5-5: too many spaces inside brackets
(brackets)
[error] 7-7: too many spaces inside brackets
(brackets)
[error] 7-7: too many spaces inside brackets
(brackets)
🤖 Prompt for AI Agents