Skip to content

Commit

Permalink
Fix CI - Use a new foundry cache (#2157)
Browse files Browse the repository at this point in the history
* use a new foundry cache

* another try

* rm repo

* fix integration test too

* pr review
  • Loading branch information
leomassazza authored Oct 10, 2023
1 parent ab3ccfb commit 4281196
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 41 deletions.
62 changes: 40 additions & 22 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
commands:
cmd-wait-for-port:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
28 changes: 19 additions & 9 deletions .circleci/src/jobs/job-cannon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
28 changes: 19 additions & 9 deletions .circleci/src/jobs/job-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion .circleci/src/snippets/job-header-machine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ machine:
image: ubuntu-2204:2022.04.1
docker_layer_caching: true
environment:
foundry_locked_commit: "232f66f9"
foundry_cache_version: "1"

0 comments on commit 4281196

Please sign in to comment.