The home for Hyperlane core contracts, sdk packages, and other infrastructure
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hyperlane-monorepo/.github/workflows/solidity.yml

230 lines
7.1 KiB

name: Solidity
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [main]
pull_request:
branches: [main]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Save caches individually
- name: Core Cache
id: core-cache
uses: actions/cache@v2
with:
path: ./solidity/optics-core/node_modules
key: ${{ runner.os }}-core-cache-${{ hashFiles('solidity/optics-core/package-lock.json') }}
- name: XApps Cache
id: xapps-cache
uses: actions/cache@v2
with:
path: ./solidity/optics-xapps/node_modules
key: ${{ runner.os }}-xapps-cache-${{ hashFiles('solidity/optics-xapps/package-lock.json') }}
- name: Tests Cache
id: tests-cache
uses: actions/cache@v2
with:
path: ./typescript/optics-tests/node_modules
key: ${{ runner.os }}-tests-cache-${{ hashFiles('typescript/optics-tests/package-lock.json') }}
- name: Deploy Cache
id: deploy-cache
uses: actions/cache@v2
with:
path: ./typescript/optics-deploy/node_modules
key: ${{ runner.os }}-deploy-cache-${{ hashFiles('typescript/optics-deploy/package-lock.json') }}
- name: Typechain Cache
id: typechain-cache
uses: actions/cache@v2
with:
path: ./typescript/typechain/node_modules
key: ${{ runner.os }}-typechain-cache-${{ hashFiles('typescript/typechain/package-lock.json') }}
- name: Multi-Provider Cache
id: provider-cache
uses: actions/cache@v2
with:
path: ./typescript/optics-provider/node_modules
key: ${{ runner.os }}-provider-cache-${{ hashFiles('typescript/optics-provider/package-lock.json') }}
# Install separately depending on cache hit
- name: Install Core
if: steps.core-cache.outputs.cache-hit != 'true'
run: cd ./solidity/optics-core && npm i
- name: Install XApps
if: steps.xapps-cache.outputs.cache-hit != 'true'
run: cd ./solidity/optics-xapps && npm i
- name: Install Tests
if: steps.tests-cache.outputs.cache-hit != 'true'
run: cd ./typescript/optics-tests && npm i
- name: Install Deploy
if: steps.deploy-cache.outputs.cache-hit != 'true'
run: cd ./typescript/optics-deploy && npm i
- name: Install Typechain
if: steps.typechain-cache.outputs.cache-hit != 'true'
run: cd ./typescript/typechain && npm i
- name: Install Multi-Provider
if: steps.provider-cache.outputs.cache-hit != 'true'
run: cd ./typescript/optics-provider && npm i
lint:
runs-on: ubuntu-latest
needs: [install]
steps:
- uses: actions/checkout@v2
# Get cache for Core and XApps
- name: Core Cache
id: core-cache
uses: actions/cache@v2
with:
path: ./solidity/optics-core/node_modules
key: ${{ runner.os }}-core-cache-${{ hashFiles('solidity/optics-core/package-lock.json') }}
- name: XApps Cache
id: xapps-cache
uses: actions/cache@v2
with:
path: ./solidity/optics-xapps/node_modules
key: ${{ runner.os }}-xapps-cache-${{ hashFiles('solidity/optics-xapps/package-lock.json') }}
# Lint
- name: Lint
run: |
cd ./solidity/optics-core
npm run lint
cd ../optics-xapps
npm run lint
test: migrate tests and deploy process to ts (#400) * refactor: migrate js lib to ts * refactor: rewrite extendEnvironment in ts * add: sample tests * add: extend hre * refactor: ts deploy and signer type * refactor: devDeploy for tests * document: isTestDeploy param, add common.test.ts * add: common tests * fix: common tests * clean: remove sample script * refactor: remove Signer type and use ethers.Signer * refactor: typescript directory * build: generate typechain * refactor: typescript code (#399) * refactor: optics-tests/optics-deploy * fix: install typechain * fix * fix: ts errors * add: merkle tests (#417) * add: merkle tests * clean: remove commented code * fix: merkle tests * test: add queue tests (#422) * Add queue tests * fix: add await to fix nonce bug * test: home ts (#401) * add: home tests * add: home tests * add: deploy home (broken) * refactor: add num confirmations to config * refactor: clean up around ts tests (#424) - add testChain.ts with utility functions for making test Chain and Deploy - refactor the Optics hardhat extension - improve typing of enums in Optics lib - remove most references to waffle (prefer ethers) - remove isTestDeploy from deployment args in favor of a test? on Deploys * refactor: clean test deploy, home tests passing * refactor: deployOptics * fix: white space * lint: fix white space * refactor: testCase vectors and imports * fix: rust test vector generation * fix: missing await Co-authored-by: James Prestwich <10149425+prestwich@users.noreply.github.com> * test: add message test (#423) * test: add message test * fix: replace require with import * fix: import for queue.test.ts * enhance: add type check * fix: import conflicts * test: add upgrade tests (#443) * test: add upgrade tests * fix: missing arg * refactor: clean up code * remove: unused code * refactor: deploy proxy * fix: unsaved code * fix: ts conflicts * add: utils ts (#453) * draft * refactor: remove waffle from home tests * fix: types, remove waffle Co-authored-by: yoduyodu <wang7ong@gmail.com> * test: add XAppConnectionManager tests (#456) * test: add XAppConnectionManager tests * test: initial setup for XAppConnectionManager tests * test: most XAppConnectionManager tests passing * fix: failing test * test: SimpleMessage ts (#468) * test: add cross-chain test utils * test: simpleMessage, mostly passing * fix: prove and process test * test: add initial state test, clean up * test: recoverymanager ts (#473) * test: add recoveryManager initial tests * fix: set recoveryManager in ts deploy * fix: set governor * test: replica ts (#483) * test: add replica tests * debug: fix failing tests * WIP: test: governance router/upgrade ts (#470) * test: add governance router tests * debug: some tests * debug: Gov Router tests * refactor: upgradeUtils * fix: missing await * test: clean up ts tests (#484) * clean: imports * refactor: utils * refactor: remove logs during testing * fix: weird bug, ethers.getSigners messes up describe blocks * delete: solidity/optics-core/js * update: pre-commit script for ts * update: pre-commit and scripts * fix: test, update with main * clean: types * fix: bad recipient handle * add: todo for gov router test * add: add back verify deploy stuff in js for now * bug: fix the governance upgrade test (#490) * fix: gov router upgrade test * feature: use TS in both solidity packages * bug: install deps in typescript dir in tests * feature: enhanced github action install * chore: disable automerge, and move lint before test Co-authored-by: Tong Wang <wang7ong@gmail.com> Co-authored-by: James Prestwich <10149425+prestwich@users.noreply.github.com> Co-authored-by: James Prestwich <james@prestwi.ch>
3 years ago
solidity-test:
env:
ETHERSCAN_API_KEY: ""
runs-on: ubuntu-latest
needs: [install]
steps:
- uses: actions/checkout@v2
# Get caches
- name: Core Cache
id: core-cache
uses: actions/cache@v2
with:
path: ./solidity/optics-core/node_modules
key: ${{ runner.os }}-core-cache-${{ hashFiles('solidity/optics-core/package-lock.json') }}
- name: XApps Cache
id: xapps-cache
uses: actions/cache@v2
with:
path: ./solidity/optics-xapps/node_modules
key: ${{ runner.os }}-xapps-cache-${{ hashFiles('solidity/optics-xapps/package-lock.json') }}
- name: Tests Cache
id: tests-cache
uses: actions/cache@v2
with:
path: ./typescript/optics-tests/node_modules
key: ${{ runner.os }}-tests-cache-${{ hashFiles('typescript/optics-tests/package-lock.json') }}
- name: Deploy Cache
id: deploy-cache
uses: actions/cache@v2
with:
path: ./typescript/optics-deploy/node_modules
key: ${{ runner.os }}-deploy-cache-${{ hashFiles('typescript/optics-deploy/package-lock.json') }}
- name: Typechain Cache
id: typechain-cache
uses: actions/cache@v2
with:
path: ./typescript/typechain/node_modules
key: ${{ runner.os }}-typechain-cache-${{ hashFiles('typescript/typechain/package-lock.json') }}
- name: Multi-Provider Cache
id: provider-cache
uses: actions/cache@v2
with:
path: ./typescript/optics-provider/node_modules
key: ${{ runner.os }}-provider-cache-${{ hashFiles('typescript/optics-provider/package-lock.json') }}
# Test
test: migrate tests and deploy process to ts (#400) * refactor: migrate js lib to ts * refactor: rewrite extendEnvironment in ts * add: sample tests * add: extend hre * refactor: ts deploy and signer type * refactor: devDeploy for tests * document: isTestDeploy param, add common.test.ts * add: common tests * fix: common tests * clean: remove sample script * refactor: remove Signer type and use ethers.Signer * refactor: typescript directory * build: generate typechain * refactor: typescript code (#399) * refactor: optics-tests/optics-deploy * fix: install typechain * fix * fix: ts errors * add: merkle tests (#417) * add: merkle tests * clean: remove commented code * fix: merkle tests * test: add queue tests (#422) * Add queue tests * fix: add await to fix nonce bug * test: home ts (#401) * add: home tests * add: home tests * add: deploy home (broken) * refactor: add num confirmations to config * refactor: clean up around ts tests (#424) - add testChain.ts with utility functions for making test Chain and Deploy - refactor the Optics hardhat extension - improve typing of enums in Optics lib - remove most references to waffle (prefer ethers) - remove isTestDeploy from deployment args in favor of a test? on Deploys * refactor: clean test deploy, home tests passing * refactor: deployOptics * fix: white space * lint: fix white space * refactor: testCase vectors and imports * fix: rust test vector generation * fix: missing await Co-authored-by: James Prestwich <10149425+prestwich@users.noreply.github.com> * test: add message test (#423) * test: add message test * fix: replace require with import * fix: import for queue.test.ts * enhance: add type check * fix: import conflicts * test: add upgrade tests (#443) * test: add upgrade tests * fix: missing arg * refactor: clean up code * remove: unused code * refactor: deploy proxy * fix: unsaved code * fix: ts conflicts * add: utils ts (#453) * draft * refactor: remove waffle from home tests * fix: types, remove waffle Co-authored-by: yoduyodu <wang7ong@gmail.com> * test: add XAppConnectionManager tests (#456) * test: add XAppConnectionManager tests * test: initial setup for XAppConnectionManager tests * test: most XAppConnectionManager tests passing * fix: failing test * test: SimpleMessage ts (#468) * test: add cross-chain test utils * test: simpleMessage, mostly passing * fix: prove and process test * test: add initial state test, clean up * test: recoverymanager ts (#473) * test: add recoveryManager initial tests * fix: set recoveryManager in ts deploy * fix: set governor * test: replica ts (#483) * test: add replica tests * debug: fix failing tests * WIP: test: governance router/upgrade ts (#470) * test: add governance router tests * debug: some tests * debug: Gov Router tests * refactor: upgradeUtils * fix: missing await * test: clean up ts tests (#484) * clean: imports * refactor: utils * refactor: remove logs during testing * fix: weird bug, ethers.getSigners messes up describe blocks * delete: solidity/optics-core/js * update: pre-commit script for ts * update: pre-commit and scripts * fix: test, update with main * clean: types * fix: bad recipient handle * add: todo for gov router test * add: add back verify deploy stuff in js for now * bug: fix the governance upgrade test (#490) * fix: gov router upgrade test * feature: use TS in both solidity packages * bug: install deps in typescript dir in tests * feature: enhanced github action install * chore: disable automerge, and move lint before test Co-authored-by: Tong Wang <wang7ong@gmail.com> Co-authored-by: James Prestwich <10149425+prestwich@users.noreply.github.com> Co-authored-by: James Prestwich <james@prestwi.ch>
3 years ago
- name: Test
run: ./scripts/test-solidity.sh
typescript-test:
env:
ETHERSCAN_API_KEY: ""
runs-on: ubuntu-latest
needs: [install]
steps:
- uses: actions/checkout@v2
# Get caches
- name: Core Cache
id: core-cache
uses: actions/cache@v2
with:
path: ./solidity/optics-core/node_modules
key: ${{ runner.os }}-core-cache-${{ hashFiles('solidity/optics-core/package-lock.json') }}
- name: XApps Cache
id: xapps-cache
uses: actions/cache@v2
with:
path: ./solidity/optics-xapps/node_modules
key: ${{ runner.os }}-xapps-cache-${{ hashFiles('solidity/optics-xapps/package-lock.json') }}
- name: Tests Cache
id: tests-cache
uses: actions/cache@v2
with:
path: ./typescript/optics-tests/node_modules
key: ${{ runner.os }}-tests-cache-${{ hashFiles('typescript/optics-tests/package-lock.json') }}
- name: Deploy Cache
id: deploy-cache
uses: actions/cache@v2
with:
path: ./typescript/optics-deploy/node_modules
key: ${{ runner.os }}-deploy-cache-${{ hashFiles('typescript/optics-deploy/package-lock.json') }}
- name: Typechain Cache
id: typechain-cache
uses: actions/cache@v2
with:
path: ./typescript/typechain/node_modules
key: ${{ runner.os }}-typechain-cache-${{ hashFiles('typescript/typechain/package-lock.json') }}
- name: Multi-Provider Cache
id: provider-cache
uses: actions/cache@v2
with:
path: ./typescript/optics-provider/node_modules
key: ${{ runner.os }}-provider-cache-${{ hashFiles('typescript/optics-provider/package-lock.json') }}
# Test
- name: optics-deploy build
run: cd ./typescript/optics-deploy && npm run build