From 4281196076f6061f2c290b3273964576b0b71403 Mon Sep 17 00:00:00 2001 From: Leonardo Massazza Date: Tue, 10 Oct 2023 12:15:07 -0300 Subject: [PATCH] Fix CI - Use a new foundry cache (#2157) * use a new foundry cache * another try * rm repo * fix integration test too * pr review --- .circleci/config.yml | 62 ++++++++++++------- .circleci/src/jobs/job-cannon.yml | 28 ++++++--- .circleci/src/jobs/job-integration-tests.yml | 28 ++++++--- .circleci/src/snippets/job-header-machine.yml | 2 +- 4 files changed, 79 insertions(+), 41 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5158b00326..0953aceaa0 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: @@ -35,21 +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}-12 + - foundry-bin-latest-${foundry_cache_version} - 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 - fi - rm -rf * - echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> $BASH_ENV + - 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}-12 + key: foundry-bin-latest-${foundry_cache_version} paths: - ~/.foundry/bin - checkout @@ -125,22 +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}-12 + - foundry-bin-latest-${foundry_cache_version} - 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 - fi - rm -rf * - echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> $BASH_ENV + - 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}-12 + key: foundry-bin-latest-${foundry_cache_version} paths: - ~/.foundry/bin - checkout @@ -288,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 77aa3c0a8b..69d7642872 100644 --- a/.circleci/src/jobs/job-cannon.yml +++ b/.circleci/src/jobs/job-cannon.yml @@ -4,18 +4,28 @@ steps: # get foundry - restore_cache: keys: - - foundry-bin-${foundry_locked_commit}-12 + - foundry-bin-latest-${foundry_cache_version} - 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 - fi - rm -rf * - echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> $BASH_ENV + - 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}-12 + 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 3e9b41c2f5..3142b4af32 100644 --- a/.circleci/src/jobs/job-integration-tests.yml +++ b/.circleci/src/jobs/job-integration-tests.yml @@ -8,18 +8,28 @@ steps: # get foundry - restore_cache: keys: - - foundry-bin-${foundry_locked_commit}-12 + - foundry-bin-latest-${foundry_cache_version} - 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 - fi - rm -rf * - echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> $BASH_ENV + - 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}-12 + 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"