-
Notifications
You must be signed in to change notification settings - Fork 21
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 12 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,156 @@ | ||||||||||||||||||||||
| 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' | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Start MagicBlock Ephemeral Validator | ||||||||||||||||||||||
| run: | | ||||||||||||||||||||||
| # Magic voodoo to increase resource limits | ||||||||||||||||||||||
| sudo prlimit --pid $$ --nofile=1048576:1048576 | ||||||||||||||||||||||
| sudo sysctl fs.inotify.max_user_instances=1280 | ||||||||||||||||||||||
| sudo sysctl fs.inotify.max_user_watches=655360 | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| RUST_LOG=info ephemeral-validator \ | ||||||||||||||||||||||
| --accounts-lifecycle ephemeral \ | ||||||||||||||||||||||
| --remote-cluster development \ | ||||||||||||||||||||||
| --remote-url http://127.0.0.1:8899 \ | ||||||||||||||||||||||
| --remote-ws-url ws://127.0.0.1:8900 \ | ||||||||||||||||||||||
| --rpc-port 7799 | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # Wait for validator to be ready | ||||||||||||||||||||||
| timeout 20 bash -c 'until curl -s http://localhost:7799 >/dev/null 2>&1; do sleep 1; done' | ||||||||||||||||||||||
|
Comment on lines
65
to
80
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. Background the MagicBlock validator or run it and its wait logic in one step.
🤖 Prompt for AI Agents |
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Build and Deploy anchor-counter | ||||||||||||||||||||||
| run: | | ||||||||||||||||||||||
| cd anchor-counter | ||||||||||||||||||||||
| anchor build && anchor deploy --provider.cluster localnet | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Test anchor-counter | ||||||||||||||||||||||
| run: | | ||||||||||||||||||||||
| cd anchor-counter | ||||||||||||||||||||||
| EPHEMERAL_PROVIDER_ENDPOINT="http://localhost:7799" \ | ||||||||||||||||||||||
| EPHEMERAL_WS_ENDPOINT="ws://localhost:7800" \ | ||||||||||||||||||||||
| anchor test \ | ||||||||||||||||||||||
| --provider.cluster localnet \ | ||||||||||||||||||||||
| --skip-local-validator \ | ||||||||||||||||||||||
| --skip-build \ | ||||||||||||||||||||||
| --skip-deploy | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||
| # - name: Test anchor-minter | ||||||||||||||||||||||
| # run: | | ||||||||||||||||||||||
| # cd anchor-minter | ||||||||||||||||||||||
| # yarn install | ||||||||||||||||||||||
| # EPHEMERAL_PROVIDER_ENDPOINT=http://localhost:7799 \ | ||||||||||||||||||||||
| # EPHEMERAL_WS_ENDPOINT=ws://localhost:7800 \ | ||||||||||||||||||||||
| # PROVIDER_ENDPOINT=http://localhost:8899 \ | ||||||||||||||||||||||
| # WS_ENDPOINT=http://localhost:8900 \ | ||||||||||||||||||||||
| # anchor test | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # - name: Test anchor-rock-paper-scissor | ||||||||||||||||||||||
| # run: | | ||||||||||||||||||||||
| # cd anchor-rock-paper-scissor | ||||||||||||||||||||||
| # yarn install | ||||||||||||||||||||||
| # EPHEMERAL_PROVIDER_ENDPOINT=http://localhost:7799 \ | ||||||||||||||||||||||
| # EPHEMERAL_WS_ENDPOINT=ws://localhost:7800 \ | ||||||||||||||||||||||
| # PROVIDER_ENDPOINT=http://localhost:8899 \ | ||||||||||||||||||||||
| # WS_ENDPOINT=http://localhost:8900 \ | ||||||||||||||||||||||
| # anchor test | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # - name: Test bolt-counter | ||||||||||||||||||||||
| # run: | | ||||||||||||||||||||||
| # cd bolt-counter | ||||||||||||||||||||||
| # yarn install | ||||||||||||||||||||||
| # EPHEMERAL_PROVIDER_ENDPOINT=http://localhost:7799 \ | ||||||||||||||||||||||
| # EPHEMERAL_WS_ENDPOINT=ws://localhost:7800 \ | ||||||||||||||||||||||
| # PROVIDER_ENDPOINT=http://localhost:8899 \ | ||||||||||||||||||||||
| # WS_ENDPOINT=http://localhost:8900 \ | ||||||||||||||||||||||
| # yarn test | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # - name: Test dummy-token-transfer | ||||||||||||||||||||||
| # run: | | ||||||||||||||||||||||
| # cd dummy-token-transfer | ||||||||||||||||||||||
| # yarn install | ||||||||||||||||||||||
| # EPHEMERAL_PROVIDER_ENDPOINT=http://localhost:7799 \ | ||||||||||||||||||||||
| # EPHEMERAL_WS_ENDPOINT=ws://localhost:7800 \ | ||||||||||||||||||||||
| # PROVIDER_ENDPOINT=http://localhost:8899 \ | ||||||||||||||||||||||
| # WS_ENDPOINT=http://localhost:8900 \ | ||||||||||||||||||||||
| # anchor test | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # - name: Test roll-dice | ||||||||||||||||||||||
| # run: | | ||||||||||||||||||||||
| # cd roll-dice | ||||||||||||||||||||||
| # yarn install | ||||||||||||||||||||||
| # EPHEMERAL_PROVIDER_ENDPOINT=http://localhost:7799 \ | ||||||||||||||||||||||
| # EPHEMERAL_WS_ENDPOINT=ws://localhost:7800 \ | ||||||||||||||||||||||
| # PROVIDER_ENDPOINT=http://localhost:8899 \ | ||||||||||||||||||||||
| # WS_ENDPOINT=http://localhost:8900 \ | ||||||||||||||||||||||
| # anchor test | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # - name: Test rust-counter | ||||||||||||||||||||||
| # run: | | ||||||||||||||||||||||
| # cd rust-counter | ||||||||||||||||||||||
| # yarn install | ||||||||||||||||||||||
| # EPHEMERAL_PROVIDER_ENDPOINT=http://localhost:7799 \ | ||||||||||||||||||||||
| # EPHEMERAL_WS_ENDPOINT=ws://localhost:7800 \ | ||||||||||||||||||||||
| # PROVIDER_ENDPOINT=http://localhost:8899 \ | ||||||||||||||||||||||
| # WS_ENDPOINT=http://localhost:8900 \ | ||||||||||||||||||||||
| # yarn test | ||||||||||||||||||||||
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