Skip to content

feed different accounts to test, prefunding them. #28

feed different accounts to test, prefunding them.

feed different accounts to test, prefunding them. #28

Workflow file for this run

name: Run tests against Fendermint (remote Docker image)
on:
push:
branches:
- main
schedule:
- cron: '0 0 * * *' # Run every day at midnight
workflow_dispatch: # Enable manual running
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout tests
uses: actions/checkout@v2
- name: Checkout Fendermint
uses: actions/checkout@v2
with:
repository: 'consensus-shipyard/fendermint'
submodules: 'recursive'
path: 'fendermint'
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: 19.8.1
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Set up Rust cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Install cargo-make
run: cargo install -f cargo-make
- uses: actions/cache/save@v3
if: always()
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run a testnode
id: testnode
run: |
cd $GITHUB_WORKSPACE/fendermint
export BALANCE=10000000000
{ out=$(cargo make --makefile ./infra/Makefile.toml testnode | tee /dev/fd/3); } 3>&1
private_key=$(echo $out | sed -e 's/\(.*\)\([a-f0-9]\{64\}\)/0x\2/' | grep 0x | head -c66)
echo "ROOT_PRIVATE_KEY=$private_key" >> "$GITHUB_OUTPUT"
cat $GITHUB_OUTPUT
- name: 'Create and fund accounts'
id: accounts
env:
NUM_ACCOUNTS: 4
ROOT_PRIVATE_KEY: ${{ steps.testnode.outputs.ROOT_PRIVATE_KEY }}
run: |
npx hardhat --network local create-fund-accounts
- name: 'Run tests: web3.js SimpleCoin'
if: always()
env:
DEPLOYER_PRIVATE_KEY: ${{ steps.testnode.outputs.ROOT_PRIVATE_KEY }}
USER_1_PRIVATE_KEY: ${{ steps.accounts.outputs.ACCOUNT1_PRIVATE_KEY }}
run: |
npx hardhat --network local test ./test/web3.js/SimpleCoin.js
- name: 'Run tests: web3.js ERC20'
if: always()
timeout-minutes: 2
env:
DEPLOYER_PRIVATE_KEY: ${{ steps.testnode.outputs.ROOT_PRIVATE_KEY }}
USER_1_PRIVATE_KEY: ${{ steps.accounts.outputs.ACCOUNT1_PRIVATE_KEY }}
run: |
npx hardhat --network local test ./test/web3.js/ERC20.js
- name: 'Run tests: ethers.js SimpleCoin'
if: always()
timeout-minutes: 2
env:
DEPLOYER_PRIVATE_KEY: ${{ steps.testnode.outputs.ROOT_PRIVATE_KEY }}
USER_1_PRIVATE_KEY: ${{ steps.accounts.outputs.ACCOUNT1_PRIVATE_KEY }}
run: |
npx hardhat --network local test ./test/ethers.js/SimpleCoin.js
- name: 'Run tests: ethers.js ERC20'
if: always()
timeout-minutes: 2
env:
DEPLOYER_PRIVATE_KEY: ${{ steps.testnode.outputs.ROOT_PRIVATE_KEY }}
USER_1_PRIVATE_KEY: ${{ steps.accounts.outputs.ACCOUNT1_PRIVATE_KEY }}
run: |
npx hardhat --network local test ./test/ethers.js/ERC20.js
- name: 'Run tests: Uniswap'
if: always()
timeout-minutes: 30
env:
DEPLOYER_PRIVATE_KEY: ${{ steps.testnode.outputs.ROOT_PRIVATE_KEY }}
USER_1_PRIVATE_KEY: ${{ steps.accounts.outputs.ACCOUNT2_PRIVATE_KEY }}
run: |
cd ./extern/fevm-uniswap-v3-core && yarn
npx hardhat --network local test || true
- name: 'Run tests: OpenZeppelin'
if: always()
timeout-minutes: 30
env:
DEPLOYER_PRIVATE_KEY: ${{ steps.testnode.outputs.ROOT_PRIVATE_KEY }}
USER_1_PRIVATE_KEY: ${{ steps.accounts.outputs.ACCOUNT3_PRIVATE_KEY }}
run: |
cd ./extern/openzeppelin-contracts/ && npm install
npx hardhat --network local test