Stimulate / Testnet #815
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: Stimulate / Testnet | |
| "on": | |
| schedule: | |
| - cron: "0 * * * *" | |
| workflow_dispatch: | |
| inputs: | |
| count: | |
| description: Number of synthetic scenarios to run | |
| required: false | |
| default: "1" | |
| type: string | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: stimulate-testnet | |
| cancel-in-progress: false | |
| jobs: | |
| stimulate-testnet: | |
| if: github.repository == 'axone-protocol/contracts' | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| ref: main | |
| persist-credentials: false | |
| - name: Cache cargo registry | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| ~/.cargo/bin | |
| ~/.rustup | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Setup Nix | |
| uses: ./.github/actions/setup-nix | |
| - name: Validate count | |
| shell: bash | |
| env: | |
| ACCOUNT_COUNT: ${{ github.event.inputs.count || '1' }} | |
| run: | | |
| set -euo pipefail | |
| count="${ACCOUNT_COUNT}" | |
| if ! [[ "${count}" =~ ^[0-9]+$ ]]; then | |
| echo "count must be an integer" >&2 | |
| exit 1 | |
| fi | |
| if (( count < 1 || count > 50 )); then | |
| echo "count must be between 1 and 50" >&2 | |
| exit 1 | |
| fi | |
| - name: Generate synthetic Axone testnet activity | |
| env: | |
| ACCOUNT_COUNT: ${{ github.event.inputs.count || '1' }} | |
| RUST_LOG: info | |
| TEST_MNEMONIC: ${{ secrets.AXONE_GITHUB_TESTNET_WALLET }} | |
| run: | | |
| set -euo pipefail | |
| for index in $(seq 1 "${ACCOUNT_COUNT}"); do | |
| nix develop -c cargo make stimulate-testnet testnet -- --run-marker "gh${GITHUB_RUN_ID}a${GITHUB_RUN_ATTEMPT}-${index}" | |
| done |