Build optics-deploy in CI (#11)

* Build optics-deploy in CI

* Split out solidity-test from typescript-test

* Run build

* Fix provider.ts
nambrot/updater-pause
Nam Chu Hoai 3 years ago committed by GitHub
parent 674e86d9ce
commit 96f916837a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 59
      .github/workflows/solidity.yml
  2. 10
      typescript/optics-deploy/src/provider.ts

@ -115,7 +115,7 @@ jobs:
cd ../optics-xapps cd ../optics-xapps
npm run lint npm run lint
test: solidity-test:
env: env:
ETHERSCAN_API_KEY: "" ETHERSCAN_API_KEY: ""
@ -171,3 +171,60 @@ jobs:
# Test # Test
- name: Test - name: Test
run: ./scripts/test-solidity.sh 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

@ -1,20 +1,20 @@
import { ExistingBridgeDeploy } from './bridge/BridgeDeploy'; import { BridgeDeploy } from './bridge/BridgeDeploy';
import { ExistingCoreDeploy } from './core/CoreDeploy'; import { CoreDeploy } from './core/CoreDeploy';
import { writeFileSync } from 'fs'; import { writeFileSync } from 'fs';
import { resolve } from 'path'; import { resolve } from 'path';
import { AllConfigs } from './config'; import { AllConfigs } from './config';
export function updateProviderDomain( export function updateProviderDomain(
environment: string, environment: string,
path: string, directory: string,
configs: AllConfigs[], configs: AllConfigs[],
) { ) {
let ret = "import { OpticsDomain } from './domain';\n" let ret = "import { OpticsDomain } from './domain';\n"
const coreDeploys = configs.map( const coreDeploys = configs.map(
(_) => new ExistingCoreDeploy(path, _.chain, _.coreConfig), (_) => CoreDeploy.fromDirectory(directory, _.chain, _.coreConfig),
); );
const bridgeDeploys = configs.map( const bridgeDeploys = configs.map(
(_) => new ExistingBridgeDeploy(_.chain, _.bridgeConfig, path), (_) => BridgeDeploy.fromDirectory(directory, _.chain, _.bridgeConfig),
); );
for (let i = 0; i < configs.length; i++) { for (let i = 0; i < configs.length; i++) {

Loading…
Cancel
Save