Skip to content

Commit

Permalink
Make foundry great again (#2298)
Browse files Browse the repository at this point in the history
  • Loading branch information
noisekit authored Sep 18, 2024
1 parent 1228b9b commit 6de51cb
Showing 1 changed file with 51 additions and 45 deletions.
96 changes: 51 additions & 45 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -811,7 +817,7 @@ workflows:

- simulate-release:
name: "synthetix--mainnet"
#requires: [compile-foundry]
requires: [compile-foundry]
workspace: "@synthetixio/main"
cannonPackage: "synthetix:latest"
cannonPreset: "main"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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.*/
Expand All @@ -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: /.*/
Expand Down

0 comments on commit 6de51cb

Please sign in to comment.