Skip to content

Commit

Permalink
CI: Split contracts bedrock (ethereum-optimism#5098)
Browse files Browse the repository at this point in the history
* CI: Split contracts bedrock

* Reuse yarn cache

* Revert --immutable flag

---------

Co-authored-by: Mark Tyneway <[email protected]>
  • Loading branch information
trianglesphere and tynes authored Mar 14, 2023
1 parent e7ff0cd commit 7bdcb0f
Showing 1 changed file with 92 additions and 17 deletions.
109 changes: 92 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,38 @@ jobs:
- checkout
- check-changed:
patterns: op-bindings,op-chain-ops,packages/
- restore_cache:
name: Restore Yarn Package Cache
keys:
- yarn-packages-v2-{{ checksum "yarn.lock" }}
- run:
name: Install dependencies
command: yarn && git diff --exit-code
command: yarn install && git diff --exit-code
- save_cache:
name: Save Yarn Package Cache
key: yarn-packages-v2-{{ checksum "yarn.lock" }}
paths:
- "node_modules"
- "packages/actor-tests/node_modules"
- "packages/atst/node_modules"
- "packages/balance-monitor/node_modules"
- "packages/chain-mon/node_modules"
- "packages/common-ts/node_modules"
- "packages/contracts/node_modules"
- "packages/contracts-bedrock/node_modules"
- "packages/contracts-governance/node_modules"
- "packages/contracts-periphery/node_modules"
- "packages/core-utils/node_modules"
- "packages/data-transport-layer/node_modules"
- "packages/drippie-mon/node_modules"
- "packages/fault-detector/node_modules"
- "packages/hardhat-deploy-config/node_modules"
- "packages/integration-tests-bedrock/node_modules"
- "packages/message-relayer/node_modules"
- "packages/migration-data/node_modules"
- "packages/replica-healthcheck/node_modules"
- "packages/sdk/node_modules"
- "packages/two-step-monitor/node_modules"
- run:
name: print forge version
command: forge --version
Expand All @@ -78,8 +107,6 @@ jobs:
- persist_to_workspace:
root: "."
paths:
- "node_modules"
- "packages/*/node_modules"
- "packages/*/dist"
- "packages/*/artifacts"
- "packages/contracts/src/contract-artifacts.ts"
Expand Down Expand Up @@ -267,18 +294,12 @@ jobs:
steps:
- checkout
- attach_workspace: { at: "." }
- restore_cache:
name: Restore Yarn Package Cache
keys:
- yarn-packages-v2-{{ checksum "yarn.lock" }}
- check-changed:
patterns: contracts-bedrock,hardhat-deploy-config
- run:
name: lint
command: yarn lint:check
working_directory: packages/contracts-bedrock
- run:
name: slither
command: |
slither --version
yarn slither || exit 0
working_directory: packages/contracts-bedrock
- run:
name: print forge version
command: forge --version
Expand All @@ -295,6 +316,27 @@ jobs:
command: codecov --verbose --clean --flags contracts-bedrock-tests
environment:
FOUNDRY_PROFILE: ci

contracts-bedrock-checks:
docker:
- image: ethereumoptimism/ci-builder:latest
steps:
- checkout
- attach_workspace: { at: "." }
- restore_cache:
name: Restore Yarn Package Cache
keys:
- yarn-packages-v2-{{ checksum "yarn.lock" }}
- run:
name: lint
command: yarn lint:check
working_directory: packages/contracts-bedrock
- run:
name: slither
command: |
slither --version
yarn slither || exit 0
working_directory: packages/contracts-bedrock
- run:
name: gas snapshot
command: |
Expand All @@ -303,10 +345,6 @@ jobs:
environment:
FOUNDRY_PROFILE: ci
working_directory: packages/contracts-bedrock
- run:
name: validate spacers
command: yarn validate-spacers
working_directory: packages/contracts-bedrock
- run:
name: storage snapshot
command: yarn storage-snapshot && git diff --exit-code .storage-layout
Expand All @@ -316,6 +354,21 @@ jobs:
command: yarn autogen:invariant-docs && git diff --exit-code ./invariant-docs/*.md
working_directory: packages/contracts-bedrock

contracts-bedrock-validate-spaces:
docker:
- image: ethereumoptimism/ci-builder:latest
steps:
- checkout
- attach_workspace: { at: "." }
- restore_cache:
name: Restore Yarn Package Cache
keys:
- yarn-packages-v2-{{ checksum "yarn.lock" }}
- run:
name: validate spacers
command: yarn validate-spacers
working_directory: packages/contracts-bedrock

bedrock-echidna-build:
docker:
- image: ethereumoptimism/ci-builder:latest
Expand Down Expand Up @@ -349,6 +402,10 @@ jobs:
steps:
- checkout
- attach_workspace: { at: "." }
- restore_cache:
name: Restore Yarn Package Cache
keys:
- yarn-packages-v2-{{ checksum "yarn.lock" }}
- check-changed:
patterns: contracts-bedrock,contracts
- run:
Expand All @@ -364,6 +421,10 @@ jobs:
steps:
- checkout
- attach_workspace: { at: "." }
- restore_cache:
name: Restore Yarn Package Cache
keys:
- yarn-packages-v2-{{ checksum "yarn.lock" }}
- check-changed:
patterns: contracts-bedrock,op-bindings
- run:
Expand All @@ -389,6 +450,10 @@ jobs:
steps:
- checkout
- attach_workspace: { at: "." }
- restore_cache:
name: Restore Yarn Package Cache
keys:
- yarn-packages-v2-{{ checksum "yarn.lock" }}
- check-changed:
patterns: <<parameters.package_name>>,<<parameters.dependencies>>
- run:
Expand Down Expand Up @@ -442,6 +507,10 @@ jobs:
steps:
- checkout
- attach_workspace: { at: "." }
- restore_cache:
name: Restore Yarn Package Cache
keys:
- yarn-packages-v2-{{ checksum "yarn.lock" }}
- check-changed:
patterns: packages
# Note: The below needs to be manually configured whenever we
Expand Down Expand Up @@ -893,6 +962,12 @@ workflows:
- contracts-bedrock-tests:
requires:
- yarn-monorepo
- contracts-bedrock-checks:
requires:
- yarn-monorepo
- contracts-bedrock-validate-spaces:
requires:
- yarn-monorepo
- op-bindings-build:
requires:
- yarn-monorepo
Expand Down

0 comments on commit 7bdcb0f

Please sign in to comment.