Skip to content

Commit

Permalink
CI changes to accommodate Anvil
Browse files Browse the repository at this point in the history
  • Loading branch information
AryaLanjewar3005 authored Mar 5, 2025
2 parents c2531f4 + 86fc556 commit d5b5ae1
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 80 deletions.
18 changes: 10 additions & 8 deletions .github/matic-cli-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@ devnetType: docker

defaultFee: 2000
defaultStake: 10000

borChainId: 15001
heimdallChainId: heimdall-15001

borDockerBuildContext: '../../bor'
heimdallDockerBuildContext: 'https://github.com/maticnetwork/heimdall.git#develop'

contractsRepo: https://github.com/0xPolygon/pos-contracts.git
contractsBranch: anvil-pos
genesisContractsBranch: master
contractsBranch: mardizzone/node-16

blockTime:
- '2'
Expand All @@ -31,6 +27,12 @@ devnetBorFlags: config,config,config
numOfErigonValidators: 0
numOfErigonSentries: 0
numOfErigonArchiveNodes: 0

ethURL: http://ganache:9545
ethURL: http://anvil:9545
ethHostUser: ubuntu
devnetType: docker
borDockerBuildContext: "../../bor"
heimdallDockerBuildContext: "https://github.com/maticnetwork/heimdall.git#develop"
sprintSizeBlockNumber:
- '0'
devnetBorFlags: config,config,config
mnemonic: 'clock radar mass judge dismiss just intact mind resemble fringe diary casino'
142 changes: 89 additions & 53 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,60 +188,96 @@ jobs:
os: [ubuntu-22.04] # List of OS: https://github.com/actions/virtual-environments
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
path: bor
- name: Checkout submodules
run: |
cd bor
git submodule update --init --recursive --force
git fetch --no-tags --prune --depth=1 origin +refs/heads/master:refs/remotes/origin/master
- uses: actions/setup-go@v5
with:
go-version: 1.23.x

- name: Checkout matic-cli
uses: actions/checkout@v4
with:
repository: maticnetwork/matic-cli
ref: master
path: matic-cli

- name: Install dependencies on Linux
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install build-essential
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
sudo snap install solc
sudo apt install python2 jq curl
sudo ln -sf /usr/bin/python2 /usr/bin/python
- uses: actions/setup-node@v3
with:
node-version: '18.19.0'
cache: 'npm'
cache-dependency-path: |
matic-cli/package-lock.json
matic-cli/devnet/code/contracts/package-lock.json
matic-cli/devnet/code/genesis-contracts/package-lock.json
matic-cli/devnet/code/genesis-contracts/matic-contracts/package-lock.json
- name: Bootstrap devnet
run: |
cd matic-cli
npm install --prefer-offline --no-audit --progress=false
mkdir devnet
cd devnet
../bin/matic-cli.js setup devnet -c ../../bor/.github/matic-cli-config.yml
- name: Launch devnet
run: |
cd matic-cli/devnet
bash ../util-scripts/docker/devnet_setup.sh
- uses: actions/checkout@v4
with:
path: bor
- name: Checkout submodules
run: |
cd bor
git submodule update --init --recursive --force
git fetch --no-tags --prune --depth=1 origin +refs/heads/master:refs/remotes/origin/master
- uses: actions/setup-go@v5
with:
go-version: 1.23.x

- name: Checkout matic-cli
uses: actions/checkout@v4
with:
repository: maticnetwork/matic-cli
ref: master
path: matic-cli

- name: Install dependencies on Linux
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install build-essential
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
sudo snap install solc
sudo apt install python2 jq curl
sudo ln -sf /usr/bin/python2 /usr/bin/python
- uses: actions/setup-node@v3
with:
node-version: '18.19.0'
cache: 'npm'
cache-dependency-path: |
matic-cli/package-lock.json
matic-cli/devnet/code/contracts/package-lock.json
matic-cli/devnet/code/genesis-contracts/package-lock.json
matic-cli/devnet/code/genesis-contracts/matic-contracts/package-lock.json
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Bootstrap devnet
run: |
cd matic-cli
npm install --prefer-offline --no-audit --progress=false
mkdir devnet
cd devnet
../bin/matic-cli.js setup devnet -c ../../bor/.github/matic-cli-config.yml
- name: Launch devnet
run: |
cd matic-cli/devnet
bash ../util-scripts/docker/devnet_setup.sh
cd -
timeout 2m bash bor/integration-tests/bor_health.sh
- name: Run smoke tests
run: |
echo "Deposit 100 matic for each account to bor network"
cd matic-cli/devnet/devnet
SCRIPT_ADDRESS=$(jq -r '.[0].address' signer-dump.json)
SCRIPT_PRIVATE_KEY=$(jq -r '.[0].priv_key' signer-dump.json)
cd ../code/pos-contracts
CONTRACT_ADDRESS=$(jq -r .root.tokens.MaticToken contractAddresses.json)
forge script scripts/matic-cli-scripts/Deposit.s.sol:MaticDeposit --rpc-url http://localhost:9545 --private-key $SCRIPT_PRIVATE_KEY --broadcast --sig "run(address,address,uint256)" $SCRIPT_ADDRESS $CONTRACT_ADDRESS 100000000000000000000
cd ../../../..
timeout 60m bash bor/integration-tests/smoke_test.sh
- name: Run RPC Tests
run: |
echo "Starting RPC Tests..."
timeout 5m bash bor/integration-tests/rpc_test.sh
- name: Upload logs
if: always()
uses: actions/[email protected]
with:
name: logs_${{ github.run_id }}
path: |
matic-cli/devnet/logs
- name: Package code and chain data
if: always()
run: |
cd matic-cli/devnet
docker compose down --remove-orphans
cd -
timeout 2m bash bor/integration-tests/bor_health.sh
timeout 2m bash bor/integration-tests/bor_health.sh
- name: Run smoke tests
run: |
Expand Down
19 changes: 0 additions & 19 deletions integration-tests/fund_ganache_accounts.sh

This file was deleted.

0 comments on commit d5b5ae1

Please sign in to comment.