Skip to content

Workflow file for this run

name: Allocation tests
on:
push:
workflow_dispatch:
schedule:
- cron: "42 3 * * *"
jobs:
test_faucet_holesky:
name: Test Holesky faucet
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
with:
shared-key: "dev-build-cache"
- name: Build
run: cargo build
- name: Generate ethereum accounts
run: |
cargo run -- generate-key -n 5 > .env
cat .env | grep ETH_ADDRESS | sed "s/#\s//g" | sed "s/:\s/=/g" > $GITHUB_ENV
- name: Show created addresses
run: |
echo "Eth address 0: $ETH_ADDRESS_0"
echo "Eth address 1: $ETH_ADDRESS_1"
echo "Eth address 2: $ETH_ADDRESS_2"
echo "Eth address 3: $ETH_ADDRESS_3"
echo "Eth address 4: $ETH_ADDRESS_4"
- name: Get ETH from faucet for account 1 and 2
run: |
cargo run -- get-dev-eth --account-no 1
cargo run -- get-dev-eth --account-no 2
- name: Check ETH balance after getting funds from faucet (should be 0.01)
run: |
sleep 60 # give time for the blockchain to propagate info about the transaction
[ $(cargo run -- balance -c holesky | jq -r ".\"$ETH_ADDRESS_1\".gasDecimal") == "0.01" ]
[ $(cargo run -- balance -c holesky | jq -r ".\"$ETH_ADDRESS_2\".gasDecimal") == "0.01" ]
- name: Mint tokens
run: |
cargo run -- mint-test-tokens -c holesky
cargo run -- run
- name: Check token balance
run: |
[ $(cargo run -- balance -c holesky | jq -r '.[] | .tokenDecimal') == "1000" ]
- name: Transfer 166.6 GLM tokens
run: |
cargo run -- transfer -c holesky --recipient 0x5b984629E2Cc7570cBa7dD745b83c3dD23Ba6d0f --token glm --amount 166.6
cargo run -- run
- name: Transfer all GLM tokens
run: |
cargo run -- transfer -c holesky --recipient 0x5b984629E2Cc7570cBa7dD745b83c3dD23Ba6d0f --token glm --all
cargo run -- run
- name: Check token balance zero
run: |
[ $(cargo run -- balance -c holesky | jq -r '.[] | .tokenDecimal') == "0" ]
- name: Transfer all left ETH tokens
run: |
cargo run -- transfer -c holesky --recipient 0x5b984629E2Cc7570cBa7dD745b83c3dD23Ba6d0f --token eth --all
cargo run -- run