Repository navigation
fix: add native lamports charge (#72) #105
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
| name: Test Examples | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| test-examples: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Setup Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: "1.85.0" | |
| override: true | |
| - name: Install Solana | |
| run: | | |
| sh -c "$(curl -sSfL https://release.anza.xyz/v2.3.13/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.32.1 | |
| avm use 0.32.1 | |
| echo "$HOME/.avm/bin" >> $GITHUB_PATH | |
| - name: Install MagicBlock Ephemeral Validator | |
| run: | | |
| npm install -g @magicblock-labs/ephemeral-validator@latest | |
| - 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: | | |
| mb-test-validator \ | |
| --ledger ./my-ledger-1 \ | |
| --reset & | |
| # 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 \ | |
| --remotes "http://localhost:8899" \ | |
| --remotes "ws://localhost:8900" \ | |
| -l "7799" \ | |
| --lifecycle ephemeral \ | |
| > /tmp/ephemeral-validator.log 2>&1 & | |
| # Wait for validator to be ready | |
| timeout 60 bash -c 'until curl -s http://localhost:7799 >/dev/null 2>&1; do sleep 1; done' || { | |
| echo "ephemeral-validator did not become ready within 60 seconds" | |
| echo "=== Last 100 lines of validator log ===" | |
| tail -100 /tmp/ephemeral-validator.log || true | |
| exit 1 | |
| } | |
| - name: Test anchor-counter | |
| run: | | |
| cd anchor-counter | |
| anchor build && anchor deploy --provider.cluster localnet | |
| 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 \ | |
| --provider.cluster localnet \ | |
| --skip-local-validator \ | |
| --skip-deploy | |
| # - name: Test anchor-minter | |
| # run: | | |
| # cd anchor-minter | |
| # anchor build && anchor deploy --provider.cluster localnet | |
| # yarn install | |
| # anchor test \ | |
| # --skip-deploy | |
| # - name: Test anchor-rock-paper-scissor | |
| # run: | | |
| # cd anchor-rock-paper-scissor | |
| # anchor build | |
| # yarn install | |
| # anchor test \ | |
| # --skip-deploy | |
| # - 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 magic-actions | |
| # run: | | |
| # cd magic-actions | |
| # yarn install | |
| # anchor build | |
| # yarn install | |
| # anchor test \ | |
| # --skip-deploy | |
| # - name: Test oncurve-delegation | |
| # run: | | |
| # cd oncurve-delegation | |
| # yarn install | |
| # yarn test | |
| # yarn test-web3js | |
| # - 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 | |
| # - name: Test session-keys | |
| # run: | | |
| # cd session-keys | |
| # yarn install | |
| # anchor build | |
| # yarn install | |
| # anchor test \ | |
| # --skip-deploy |