From 8ba92eb0caf1673d4faa70cfc136ab5d59125c38 Mon Sep 17 00:00:00 2001 From: Leonardo Massazza Date: Mon, 9 Oct 2023 13:07:01 -0300 Subject: [PATCH 1/5] use a new foundry cache --- .circleci/config.yml | 6 +++--- .circleci/src/jobs/job-cannon.yml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5158b00326..a3d4cd95cf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ # DO NOT EDIT MANUALLY! instead run `npm run build:ci` # autogenerated by `.circleci/pack.js` from contents of `jobs` .yml files version: 2.1 -orbs: +orbs: rust: circleci/rust@1.6.0 commands: cmd-wait-for-port: @@ -39,7 +39,7 @@ jobs: steps: - restore_cache: keys: - - foundry-bin-${foundry_locked_commit}-12 + - foundry-bin-${foundry_locked_commit}-13 - rust/install: {} - run: | if [ ! -d ~/.foundry ]; then @@ -49,7 +49,7 @@ jobs: rm -rf * echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> $BASH_ENV - save_cache: - key: foundry-bin-${foundry_locked_commit}-12 + key: foundry-bin-${foundry_locked_commit}-13 paths: - ~/.foundry/bin - checkout diff --git a/.circleci/src/jobs/job-cannon.yml b/.circleci/src/jobs/job-cannon.yml index 77aa3c0a8b..d998530b82 100644 --- a/.circleci/src/jobs/job-cannon.yml +++ b/.circleci/src/jobs/job-cannon.yml @@ -4,7 +4,7 @@ steps: # get foundry - restore_cache: keys: - - foundry-bin-${foundry_locked_commit}-12 + - foundry-bin-${foundry_locked_commit}-13 - rust/install: {} - run: | if [ ! -d ~/.foundry ]; then @@ -15,7 +15,7 @@ steps: echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> $BASH_ENV - save_cache: - key: foundry-bin-${foundry_locked_commit}-12 + key: foundry-bin-${foundry_locked_commit}-13 paths: - ~/.foundry/bin From 2d37430acaf21fd2024d5a494f0628c3dbeb476f Mon Sep 17 00:00:00 2001 From: Leonardo Massazza Date: Mon, 9 Oct 2023 17:58:17 -0300 Subject: [PATCH 2/5] another try --- .circleci/config.yml | 14 ++++++++------ .circleci/src/jobs/job-cannon.yml | 14 ++++++++------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a3d4cd95cf..12feee962d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,17 +39,19 @@ jobs: steps: - restore_cache: keys: - - foundry-bin-${foundry_locked_commit}-13 + - foundry-bin-${foundry_locked_commit}-14 - rust/install: {} - run: | if [ ! -d ~/.foundry ]; then - curl -O https://raw.githubusercontent.com/foundry-rs/foundry/master/foundryup/foundryup && chmod +x ./foundryup - ./foundryup -C $foundry_locked_commit + curl -L https://foundry.paradigm.xyz | bash + echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> ~/.bashrc + source ~/.bashrc + foundryup fi - rm -rf * - echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> $BASH_ENV + echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> ~/.bashrc + source ~/.bashrc - save_cache: - key: foundry-bin-${foundry_locked_commit}-13 + key: foundry-bin-${foundry_locked_commit}-14 paths: - ~/.foundry/bin - checkout diff --git a/.circleci/src/jobs/job-cannon.yml b/.circleci/src/jobs/job-cannon.yml index d998530b82..b5a5ae40db 100644 --- a/.circleci/src/jobs/job-cannon.yml +++ b/.circleci/src/jobs/job-cannon.yml @@ -4,18 +4,20 @@ steps: # get foundry - restore_cache: keys: - - foundry-bin-${foundry_locked_commit}-13 + - foundry-bin-${foundry_locked_commit}-14 - rust/install: {} - run: | if [ ! -d ~/.foundry ]; then - curl -O https://raw.githubusercontent.com/foundry-rs/foundry/master/foundryup/foundryup && chmod +x ./foundryup - ./foundryup -C $foundry_locked_commit + curl -L https://foundry.paradigm.xyz | bash + echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> ~/.bashrc + source ~/.bashrc + foundryup fi - rm -rf * - echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> $BASH_ENV + echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> ~/.bashrc + source ~/.bashrc - save_cache: - key: foundry-bin-${foundry_locked_commit}-13 + key: foundry-bin-${foundry_locked_commit}-14 paths: - ~/.foundry/bin From 5b2ba1f8a815b0651168df5ca0d017c00989d57e Mon Sep 17 00:00:00 2001 From: Leonardo Massazza Date: Mon, 9 Oct 2023 18:01:54 -0300 Subject: [PATCH 3/5] rm repo --- .circleci/config.yml | 1 + .circleci/src/jobs/job-cannon.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 12feee962d..1cfae888a8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -48,6 +48,7 @@ jobs: source ~/.bashrc foundryup fi + rm -rf * echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> ~/.bashrc source ~/.bashrc - save_cache: diff --git a/.circleci/src/jobs/job-cannon.yml b/.circleci/src/jobs/job-cannon.yml index b5a5ae40db..0b21bb2fb0 100644 --- a/.circleci/src/jobs/job-cannon.yml +++ b/.circleci/src/jobs/job-cannon.yml @@ -13,6 +13,7 @@ steps: source ~/.bashrc foundryup fi + rm -rf * echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> ~/.bashrc source ~/.bashrc From bcd154a5c1fe32a79de658b3b62c1722cdaa1eed Mon Sep 17 00:00:00 2001 From: Leonardo Massazza Date: Mon, 9 Oct 2023 19:33:27 -0300 Subject: [PATCH 4/5] fix integration test too --- .circleci/config.yml | 13 ++++++++----- .circleci/src/jobs/job-integration-tests.yml | 13 ++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1cfae888a8..53322f98fb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -133,17 +133,20 @@ jobs: steps: - restore_cache: keys: - - foundry-bin-${foundry_locked_commit}-12 + - foundry-bin-${foundry_locked_commit}-14 - rust/install: {} - run: | if [ ! -d ~/.foundry ]; then - curl -O https://raw.githubusercontent.com/foundry-rs/foundry/master/foundryup/foundryup && chmod +x ./foundryup - ./foundryup -C $foundry_locked_commit + curl -L https://foundry.paradigm.xyz | bash + echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> ~/.bashrc + source ~/.bashrc + foundryup fi rm -rf * - echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> $BASH_ENV + echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> ~/.bashrc + source ~/.bashrc - save_cache: - key: foundry-bin-${foundry_locked_commit}-12 + key: foundry-bin-${foundry_locked_commit}-14 paths: - ~/.foundry/bin - checkout diff --git a/.circleci/src/jobs/job-integration-tests.yml b/.circleci/src/jobs/job-integration-tests.yml index 3e9b41c2f5..d808570aa0 100644 --- a/.circleci/src/jobs/job-integration-tests.yml +++ b/.circleci/src/jobs/job-integration-tests.yml @@ -8,18 +8,21 @@ steps: # get foundry - restore_cache: keys: - - foundry-bin-${foundry_locked_commit}-12 + - foundry-bin-${foundry_locked_commit}-14 - rust/install: {} - run: | if [ ! -d ~/.foundry ]; then - curl -O https://raw.githubusercontent.com/foundry-rs/foundry/master/foundryup/foundryup && chmod +x ./foundryup - ./foundryup -C $foundry_locked_commit + curl -L https://foundry.paradigm.xyz | bash + echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> ~/.bashrc + source ~/.bashrc + foundryup fi rm -rf * - echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> $BASH_ENV + echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> ~/.bashrc + source ~/.bashrc - save_cache: - key: foundry-bin-${foundry_locked_commit}-12 + key: foundry-bin-${foundry_locked_commit}-14 paths: - ~/.foundry/bin From b98b37fa7edab86780e6de94ffc4aaaab42c1498 Mon Sep 17 00:00:00 2001 From: Leonardo Massazza Date: Tue, 10 Oct 2023 11:01:07 -0300 Subject: [PATCH 5/5] pr review --- .circleci/config.yml | 66 +++++++++++-------- .circleci/src/jobs/job-cannon.yml | 31 +++++---- .circleci/src/jobs/job-integration-tests.yml | 31 +++++---- .circleci/src/snippets/job-header-machine.yml | 2 +- 4 files changed, 78 insertions(+), 52 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 53322f98fb..0953aceaa0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,24 +35,30 @@ jobs: image: ubuntu-2204:2022.04.1 docker_layer_caching: true environment: - foundry_locked_commit: "232f66f9" + foundry_cache_version: "1" steps: - restore_cache: keys: - - foundry-bin-${foundry_locked_commit}-14 + - foundry-bin-latest-${foundry_cache_version} - rust/install: {} - - run: | - if [ ! -d ~/.foundry ]; then - curl -L https://foundry.paradigm.xyz | bash - echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> ~/.bashrc - source ~/.bashrc - foundryup - fi - rm -rf * - echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> ~/.bashrc - source ~/.bashrc + - run: + name: "Install Foundry" + working_directory: ~/ + environment: + SHELL: /bin/bash + command: |- + export PATH="$PATH:$HOME/.foundry/bin" + echo 'export PATH=$PATH:$HOME/.foundry/bin' >> $BASH_ENV + if command -v anvil; then + echo "Anvil already installed" + anvil --version + else + curl -L https://foundry.paradigm.xyz | bash + foundryup + fi + rm -rf * - save_cache: - key: foundry-bin-${foundry_locked_commit}-14 + key: foundry-bin-latest-${foundry_cache_version} paths: - ~/.foundry/bin - checkout @@ -128,25 +134,31 @@ jobs: image: ubuntu-2204:2022.04.1 docker_layer_caching: true environment: - foundry_locked_commit: "232f66f9" + foundry_cache_version: "1" resource_class: large steps: - restore_cache: keys: - - foundry-bin-${foundry_locked_commit}-14 + - foundry-bin-latest-${foundry_cache_version} - rust/install: {} - - run: | - if [ ! -d ~/.foundry ]; then - curl -L https://foundry.paradigm.xyz | bash - echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> ~/.bashrc - source ~/.bashrc - foundryup - fi - rm -rf * - echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> ~/.bashrc - source ~/.bashrc + - run: + name: "Install Foundry" + working_directory: ~/ + environment: + SHELL: /bin/bash + command: |- + export PATH="$PATH:$HOME/.foundry/bin" + echo 'export PATH=$PATH:$HOME/.foundry/bin' >> $BASH_ENV + if command -v anvil; then + echo "Anvil already installed" + anvil --version + else + curl -L https://foundry.paradigm.xyz | bash + foundryup + fi + rm -rf * - save_cache: - key: foundry-bin-${foundry_locked_commit}-14 + key: foundry-bin-latest-${foundry_cache_version} paths: - ~/.foundry/bin - checkout @@ -294,7 +306,7 @@ jobs: image: ubuntu-2204:2022.04.1 docker_layer_caching: true environment: - foundry_locked_commit: "232f66f9" + foundry_cache_version: "1" resource_class: large steps: - restore_cache: diff --git a/.circleci/src/jobs/job-cannon.yml b/.circleci/src/jobs/job-cannon.yml index 0b21bb2fb0..69d7642872 100644 --- a/.circleci/src/jobs/job-cannon.yml +++ b/.circleci/src/jobs/job-cannon.yml @@ -4,21 +4,28 @@ steps: # get foundry - restore_cache: keys: - - foundry-bin-${foundry_locked_commit}-14 + - foundry-bin-latest-${foundry_cache_version} - rust/install: {} - - run: | - if [ ! -d ~/.foundry ]; then - curl -L https://foundry.paradigm.xyz | bash - echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> ~/.bashrc - source ~/.bashrc - foundryup - fi - rm -rf * - echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> ~/.bashrc - source ~/.bashrc + - run: + name: "Install Foundry" + working_directory: ~/ + environment: + SHELL: /bin/bash + command: |- + export PATH="$PATH:$HOME/.foundry/bin" + echo 'export PATH=$PATH:$HOME/.foundry/bin' >> $BASH_ENV + + if command -v anvil; then + echo "Anvil already installed" + anvil --version + else + curl -L https://foundry.paradigm.xyz | bash + foundryup + fi + rm -rf * - save_cache: - key: foundry-bin-${foundry_locked_commit}-14 + key: foundry-bin-latest-${foundry_cache_version} paths: - ~/.foundry/bin diff --git a/.circleci/src/jobs/job-integration-tests.yml b/.circleci/src/jobs/job-integration-tests.yml index d808570aa0..3142b4af32 100644 --- a/.circleci/src/jobs/job-integration-tests.yml +++ b/.circleci/src/jobs/job-integration-tests.yml @@ -8,21 +8,28 @@ steps: # get foundry - restore_cache: keys: - - foundry-bin-${foundry_locked_commit}-14 + - foundry-bin-latest-${foundry_cache_version} - rust/install: {} - - run: | - if [ ! -d ~/.foundry ]; then - curl -L https://foundry.paradigm.xyz | bash - echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> ~/.bashrc - source ~/.bashrc - foundryup - fi - rm -rf * - echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> ~/.bashrc - source ~/.bashrc + - run: + name: "Install Foundry" + working_directory: ~/ + environment: + SHELL: /bin/bash + command: |- + export PATH="$PATH:$HOME/.foundry/bin" + echo 'export PATH=$PATH:$HOME/.foundry/bin' >> $BASH_ENV + + if command -v anvil; then + echo "Anvil already installed" + anvil --version + else + curl -L https://foundry.paradigm.xyz | bash + foundryup + fi + rm -rf * - save_cache: - key: foundry-bin-${foundry_locked_commit}-14 + key: foundry-bin-latest-${foundry_cache_version} paths: - ~/.foundry/bin diff --git a/.circleci/src/snippets/job-header-machine.yml b/.circleci/src/snippets/job-header-machine.yml index 90e5ad9d93..4939ca34c3 100644 --- a/.circleci/src/snippets/job-header-machine.yml +++ b/.circleci/src/snippets/job-header-machine.yml @@ -3,4 +3,4 @@ machine: image: ubuntu-2204:2022.04.1 docker_layer_caching: true environment: - foundry_locked_commit: "232f66f9" + foundry_cache_version: "1"