Skip to content

ci

ci #1

Workflow file for this run

name: CI
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: Run tests (faucet)
run: cargo run -- generate-key -n 1 > .env
- name: Check if balance is 0
run: |
[ $(cargo run -- balance -c holesky | jq -r '.[] | .gasDecimal') == "0" ]
[ $(cargo run -- balance -c holesky | jq -r '.[] | .tokenDecimal') == "0" ]
- name: Get ETH from faucet
run: cargo run -- get-dev-eth -c holesky
- 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 '.[] | .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