Skip to content

Commit

Permalink
Add foundry cache
Browse files Browse the repository at this point in the history
  • Loading branch information
r0qs committed Apr 6, 2023
1 parent d923926 commit ea839c6
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ commands:
default: "nightly"
steps:
- run:
name: Install foundry
name: Setup Foundry environment variables
command: |
FOUNDRY_REPO="foundry-rs/foundry"
FOUNDRY_VERSION=<< parameters.version >>
Expand All @@ -161,11 +161,25 @@ commands:
"https://api.github.com/repos/${FOUNDRY_REPO}/git/refs/tags/${FOUNDRY_VERSION}" \
| jq --raw-output .object.sha \
)
FOUNDRY_RELEASE_TAG="nightly-${FOUNDRY_RELEASE_SHA}"
echo "export FOUNDRY_REPO=$FOUNDRY_REPO" >> "$BASH_ENV"
echo "export FOUNDRY_VERSION=$FOUNDRY_VERSION" >> "$BASH_ENV"
echo "export FOUNDRY_RELEASE_TAG='nightly-${FOUNDRY_RELEASE_SHA}'" >> "$BASH_ENV"
# Save commit sha for caching
echo $FOUNDRY_RELEASE_SHA > /tmp/workspace/foundry-release-sha
- restore_cache:
keys:
- foundry-<< parameters.version >>-{{ checksum "/tmp/workspace/foundry-release-sha" }}
- run:
name: Install foundry
command: |
wget \
--output-document /tmp/foundry.tar.gz \
"https://github.com/${FOUNDRY_REPO}/releases/download/${FOUNDRY_RELEASE_TAG}/foundry_${FOUNDRY_VERSION}_linux_amd64.tar.gz"
sudo tar --extract --gzip --file /tmp/foundry.tar.gz --directory /usr/local/bin
- save_cache:
key: foundry-<< parameters.version >>-{{ checksum "/tmp/workspace/foundry-release-sha" }}
paths:
- /usr/local/bin/forge

defaults:

Expand Down

0 comments on commit ea839c6

Please sign in to comment.