GitHub Action
Provision a testnet for every CI run.
Octaze-Dev/setup-vnet spins up a virtual testnet for a workflow run, exposes its RPC as an environment variable, and tears it down afterwards.
- Source: github.com/Octaze-Dev/setup-vnet
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Octaze-Dev/setup-vnet@v1
with:
api-key: ${{ secrets.OCTAZE_API_KEY }}
# OCTAZE_RPC_URL is now available to every following step
- run: anchor test --provider.cluster $OCTAZE_RPC_URLInputs
| Name | Required | Default | Description |
|---|---|---|---|
api-key | yes | — | Octaze API key. Store as a repository secret. |
name | no | run-based slug | Name for the testnet. |
network | no | mainnet | mainnet or devnet. |
mode | no | ci | ci deletes after the job; cd keeps it. |
base-url | no | https://app.octaze.dev | Octaze API base URL. |
Outputs & env
Exported for later steps: OCTAZE_RPC_URL, OCTAZE_RPC_WSS, OCTAZE_TESTNET_ID.
Also available as step outputs: rpc-url, rpc-wss, testnet-id.
CI vs CD
- CI (default) — the testnet is deleted in a post step after the job, even if tests fail.
- CD — the testnet is kept running so you can use it as a staging environment.