From 6de51cbaa60c2fb3d9bdfd18928a81b744727fa0 Mon Sep 17 00:00:00 2001 From: Noisekit <28145325+noisekit@users.noreply.github.com> Date: Wed, 18 Sep 2024 20:01:09 +0800 Subject: [PATCH] Make foundry great again (#2298) --- .circleci/config.yml | 96 +++++++++++++++++++++++--------------------- 1 file changed, 51 insertions(+), 45 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 92ed4dc105..ee1b13bc69 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,7 +24,7 @@ commands: steps: - restore_cache: keys: - - foundry-{{ .Environment.FOUNDRY_CACHE_VERSION }} + - foundry-{{ .Environment.FOUNDRY_CACHE_VERSION }}-{{ .Environment.FOUNDRY_COMMIT }} - run: name: "Add .foundry/bin to PATH" @@ -39,21 +39,29 @@ commands: forge --version else echo "Forge needs to be installed" - + exit 1 # EXIT! We must compile curl -L https://foundry.paradigm.xyz | bash cd .foundry/bin ./foundryup forge --version fi - - save_cache: - key: foundry-{{ .Environment.FOUNDRY_CACHE_VERSION }} - paths: - - "~/.foundry/bin" + #- save_cache: + # key: foundry-{{ .Environment.FOUNDRY_CACHE_VERSION }} + # paths: + # - "~/.foundry/bin" compile-foundry: steps: - - install-foundry + - restore_cache: + keys: + - foundry-{{ .Environment.FOUNDRY_CACHE_VERSION }}-{{ .Environment.FOUNDRY_COMMIT }} + + - run: + name: "Add .foundry/bin to PATH" + command: |- + export PATH="$PATH:$HOME/.foundry/bin" + echo 'export PATH=$PATH:$HOME/.foundry/bin' >> $BASH_ENV - run: name: "Install Foundry" @@ -695,16 +703,14 @@ workflows: - equal: ["scheduled_pipeline", << pipeline.trigger_source >>] jobs: - # - compile-foundry + - compile-foundry - lint - size-contracts - - verify-storage - # - verify-storage - # #requires: [compile-foundry] + - verify-storage: + requires: [compile-foundry] - - build-testable - # - build-testable: - # #requires: [compile-foundry] + - build-testable: + requires: [compile-foundry] - test-contracts: name: "test-main" @@ -743,7 +749,7 @@ workflows: - test-contracts: name: "test-core-modules" - #requires: [compile-foundry] + requires: [compile-foundry] dir: "./utils/core-modules" parallelism: 1 batch-size: 5 @@ -757,14 +763,14 @@ workflows: - test-contracts: name: "test-core-utils" - #requires: [compile-foundry] + requires: [compile-foundry] dir: "./utils/core-utils" parallelism: 2 batch-size: 5 - test-forge: name: "test-rewards-distributor" - #requires: [compile-foundry] + requires: [compile-foundry] workspace: "@synthetixio/rewards-distributor" - test-subgraph: @@ -781,7 +787,7 @@ workflows: - simulate-release: name: "synthetix--base-mainnet-andromeda" - #requires: [compile-foundry] + requires: [compile-foundry] workspace: "@synthetixio/main" cannonPackage: "synthetix:latest" cannonPreset: "andromeda" @@ -791,7 +797,7 @@ workflows: - simulate-release: name: "synthetix--base-sepolia-andromeda" - #requires: [compile-foundry] + requires: [compile-foundry] workspace: "@synthetixio/main" cannonPackage: "synthetix:latest" cannonPreset: "andromeda" @@ -801,7 +807,7 @@ workflows: - simulate-release: name: "synthetix--optimism-mainnet" - #requires: [compile-foundry] + requires: [compile-foundry] workspace: "@synthetixio/main" cannonPackage: "synthetix:latest" cannonPreset: "main" @@ -811,7 +817,7 @@ workflows: - simulate-release: name: "synthetix--mainnet" - #requires: [compile-foundry] + requires: [compile-foundry] workspace: "@synthetixio/main" cannonPackage: "synthetix:latest" cannonPreset: "main" @@ -821,7 +827,7 @@ workflows: - simulate-release: name: "oracle-manager--base-mainnet-andromeda" - #requires: [compile-foundry] + requires: [compile-foundry] workspace: "@synthetixio/oracle-manager" cannonPackage: "oracle-manager:latest" cannonPreset: "with-synthetix" @@ -831,7 +837,7 @@ workflows: - simulate-release: name: "oracle-manager--base-sepolia-andromeda" - #requires: [compile-foundry] + requires: [compile-foundry] workspace: "@synthetixio/oracle-manager" cannonPackage: "oracle-manager:latest" cannonPreset: "with-synthetix" @@ -841,7 +847,7 @@ workflows: - simulate-release: name: "oracle-manager--optimism-mainnet" - #requires: [compile-foundry] + requires: [compile-foundry] workspace: "@synthetixio/oracle-manager" cannonPackage: "oracle-manager:latest" cannonPreset: "with-synthetix" @@ -851,7 +857,7 @@ workflows: - simulate-release: name: "oracle-manager--mainnet" - #requires: [compile-foundry] + requires: [compile-foundry] workspace: "@synthetixio/oracle-manager" cannonPackage: "oracle-manager:latest" cannonPreset: "with-synthetix" @@ -861,7 +867,7 @@ workflows: - simulate-release: name: "spot-market--base-mainnet-andromeda" - #requires: [compile-foundry] + requires: [compile-foundry] workspace: "@synthetixio/spot-market" cannonPackage: "synthetix-spot-market:latest" cannonPreset: "andromeda" @@ -871,7 +877,7 @@ workflows: - simulate-release: name: "spot-market--base-sepolia-andromeda" - #requires: [compile-foundry] + requires: [compile-foundry] workspace: "@synthetixio/spot-market" cannonPackage: "synthetix-spot-market:latest" cannonPreset: "andromeda" @@ -881,7 +887,7 @@ workflows: - simulate-release: name: "spot-market--optimism-mainnet" - #requires: [compile-foundry] + requires: [compile-foundry] workspace: "@synthetixio/spot-market" cannonPackage: "synthetix-spot-market:latest" cannonPreset: "main" @@ -891,7 +897,7 @@ workflows: - simulate-release: name: "perps-market--base-mainnet-andromeda" - #requires: [compile-foundry] + requires: [compile-foundry] workspace: "@synthetixio/perps-market" cannonPackage: "synthetix-perps-market:latest" cannonPreset: "andromeda" @@ -901,7 +907,7 @@ workflows: - simulate-release: name: "perps-market--base-sepolia-andromeda" - #requires: [compile-foundry] + requires: [compile-foundry] workspace: "@synthetixio/perps-market" cannonPackage: "synthetix-perps-market:latest" cannonPreset: "andromeda" @@ -912,7 +918,7 @@ workflows: # TODO: Uncomment when deployed #- simulate-release: # name: "perps-market--optimism-mainnet" - # #requires: [compile-foundry] + # requires: [compile-foundry] # workspace: "@synthetixio/perps-market" # cannonPackage: "synthetix-perps-market:latest" # cannonPreset: "main" @@ -936,15 +942,15 @@ workflows: or: - equal: ["scheduled_pipeline", << pipeline.trigger_source >>] jobs: - # - compile-foundry: - # filters: - # tags: - # only: /^v.*/ - # branches: - # ignore: /.*/ + - compile-foundry: + filters: + tags: + only: /^v.*/ + branches: + ignore: /.*/ - docgen-contracts: name: "docgen-contracts" - #requires: [compile-foundry] + requires: [compile-foundry] filters: tags: only: /^v.*/ @@ -956,14 +962,14 @@ workflows: or: - equal: ["scheduled_pipeline", << pipeline.trigger_source >>] jobs: - # - compile-foundry: - # filters: - # tags: - # ignore: /.*/ - # branches: - # only: /docgen-contracts/ + - compile-foundry: + filters: + tags: + ignore: /.*/ + branches: + only: /docgen-contracts/ - docgen-contracts: - #requires: [compile-foundry] + requires: [compile-foundry] filters: tags: ignore: /.*/