From b98b37fa7edab86780e6de94ffc4aaaab42c1498 Mon Sep 17 00:00:00 2001 From: Leonardo Massazza Date: Tue, 10 Oct 2023 11:01:07 -0300 Subject: [PATCH] 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"