From 5f2e00a983d93378be05fc6b59f4dec957658866 Mon Sep 17 00:00:00 2001 From: Georgios Konstantopoulos Date: Wed, 31 Mar 2021 19:51:40 +0300 Subject: [PATCH] perf: improve contracts build time (#24) * perf: improve contracts build time * chore: clean tsconfig.buildinfo * ci: try running CI --- .github/workflows/ts-packages.yml | 8 +++++--- packages/contracts/package.json | 4 ++-- packages/contracts/scripts/build.sh | 10 ++++++++++ 3 files changed, 17 insertions(+), 5 deletions(-) create mode 100755 packages/contracts/scripts/build.sh diff --git a/.github/workflows/ts-packages.yml b/.github/workflows/ts-packages.yml index c9d1dc6d36a0..dfa1e693268f 100644 --- a/.github/workflows/ts-packages.yml +++ b/.github/workflows/ts-packages.yml @@ -1,16 +1,18 @@ -name: optimism - lint, test +name: typescript / contracts on: push: branches: - master paths: - - 'packages/**' + - 'packages/**/*.sol' + - 'packages/**/*.ts' pull_request: branches: - master paths: - - 'packages/**' + - 'packages/**/*.sol' + - 'packages/**/*.ts' jobs: build-test-lint: diff --git a/packages/contracts/package.json b/packages/contracts/package.json index 73431bf510c1..b4fd1549c145 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -9,7 +9,7 @@ "license": "MIT", "scripts": { "all": "yarn clean && yarn build && yarn test && yarn lint:fix && yarn lint", - "build": "yarn run build:contracts && yarn run build:contracts:ovm && yarn run build:typescript && yarn run build:copy && yarn run build:dump && yarn run build:typechain", + "build": "./scripts/build.sh", "build:kovan": "yarn run build:contracts && yarn run build:typescript && yarn run build:copy && CHAIN_ID=69 yarn run build:dump && yarn run build:typechain", "build:mainnet": "yarn run build:contracts && yarn run build:typescript && yarn run build:copy && CHAIN_ID=10 yarn run build:dump && yarn run build:typechain", "build:typescript": "tsc -p ./tsconfig.build.json", @@ -28,7 +28,7 @@ "lint:typescript": "tslint --format stylish --project .", "lint:fix": "yarn run lint:fix:typescript", "lint:fix:typescript": "prettier --config prettier-config.json --write \"hardhat.config.ts\" \"{src,test}/**/*.ts\"", - "clean": "rm -rf ./dist ./artifacts ./artifacts-ovm ./cache ./cache-ovm", + "clean": "rm -rf ./dist ./artifacts ./artifacts-ovm ./cache ./cache-ovm ./tsconfig.build.tsbuildinfo", "deploy": "./bin/deploy.js", "serve": "./bin/serve_dump.sh" }, diff --git a/packages/contracts/scripts/build.sh b/packages/contracts/scripts/build.sh new file mode 100755 index 000000000000..da28c3b6aaff --- /dev/null +++ b/packages/contracts/scripts/build.sh @@ -0,0 +1,10 @@ +yarn run build:typescript & +yarn run build:contracts:ovm & +yarn run build:contracts & + +wait + +yarn run build:copy:artifacts & +yarn run build:copy:artifacts:ovm & +yarn run build:copy:contracts & +wait