Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 34 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ jobs:
working_directory: ./packages/boba/bundler

- restore_cache: # special step to restore the dependency cache
key: dependency-cache-{{ checksum "yarn.lock" }}-{{ checksum "./packages/boba/bundler/all.deps" }}
key: dependency-cache-{{ checksum "yarn.lock" }}-{{ checksum "./packages/boba/bundler/all.deps" }}-{{ .Environment.CACHE_VERSION }}

- run:
name: yarn-install-if-no-cache
command: test -d node_modules/truffle || yarn
working_directory: ./packages/boba/bundler

- save_cache: # special step to save the dependency cache
key: dependency-cache-{{ checksum "yarn.lock" }}-{{ checksum "./packages/boba/bundler/all.deps" }}
key: dependency-cache-{{ checksum "yarn.lock" }}-{{ checksum "./packages/boba/bundler/all.deps" }}-{{ .Environment.CACHE_VERSION }}
paths:
- ./packages/boba/bundler/node_modules
- ./packages/boba/bundler/packages/node_modules
Expand Down Expand Up @@ -153,6 +153,38 @@ jobs:
parallelism: 4
steps:
- checkout

- run:
name: Generate cache key from all hardhat.config.ts files
working_directory: ops
command: ./scripts/checksum.sh /tmp/checksum.txt

- restore_cache:
keys:
- solc-compilers-{{ checksum "/tmp/checksum.txt" }}-{{ .Environment.CACHE_VERSION }}

- run:
name: Cache compliers
command: |
mkdir -p /home/circleci/.cache/hardhat-nodejs/compilers-v2/linux-amd64/
cd /home/circleci/.cache/hardhat-nodejs/compilers-v2/linux-amd64/

find . -name list.json | grep . || curl -L https://github.com/ethereum/solc-bin/raw/gh-pages/linux-amd64/list.json -o ./list.json
find . -name solc-linux-amd64-v0.4.11+commit.68ef5810 | grep . || curl -L https://binaries.soliditylang.org/linux-amd64/solc-linux-amd64-v0.4.11+commit.68ef5810 -o ./solc-linux-amd64-v0.4.11+commit.68ef5810
find . -name solc-linux-amd64-v0.5.17+commit.d19bba13 | grep . || curl -L https://binaries.soliditylang.org/linux-amd64/solc-linux-amd64-v0.5.17+commit.d19bba13 -o ./solc-linux-amd64-v0.5.17+commit.d19bba13
find . -name solc-linux-amd64-v0.6.6+commit.6c089d02 | grep . || curl -L https://binaries.soliditylang.org/linux-amd64/solc-linux-amd64-v0.6.6+commit.6c089d02 -o ./solc-linux-amd64-v0.6.6+commit.6c089d02
find . -name solc-linux-amd64-v0.8.9+commit.e5eed63a | grep . || curl -L https://binaries.soliditylang.org/linux-amd64/solc-linux-amd64-v0.8.9+commit.e5eed63a -o ./solc-linux-amd64-v0.8.9+commit.e5eed63a
find . -name solc-linux-amd64-v0.8.11+commit.d7f03943 | grep . || curl -L https://binaries.soliditylang.org/linux-amd64/solc-linux-amd64-v0.8.11+commit.d7f03943 -o ./solc-linux-amd64-v0.8.11+commit.d7f03943
find . -name solc-linux-amd64-v0.8.15+commit.e14f2714 | grep . || curl -L https://binaries.soliditylang.org/linux-amd64/solc-linux-amd64-v0.8.15+commit.e14f2714 -o ./solc-linux-amd64-v0.8.15+commit.e14f2714
find . -name solc-linux-amd64-v0.8.17+commit.8df45f5f | grep . || curl -L https://binaries.soliditylang.org/linux-amd64/solc-linux-amd64-v0.8.17+commit.8df45f5f -o ./solc-linux-amd64-v0.8.17+commit.8df45f5f
chmod +x /home/circleci/.cache/hardhat-nodejs/compilers-v2/linux-amd64/*
working_directory: /

- save_cache:
key: solc-compilers-{{ checksum "/tmp/checksum.txt" }}-{{ .Environment.CACHE_VERSION }}
paths:
- /home/circleci/.cache/hardhat-nodejs/compilers-v2/linux-amd64/

- run:
name: Build the project
command: yarn && yarn build
Expand Down
23 changes: 23 additions & 0 deletions ops/scripts/checksum.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
RESULT_FILE=$1

if [ -f $RESULT_FILE ]; then
rm $RESULT_FILE
fi
touch $RESULT_FILE

checksum_file() {
echo `openssl md5 $1 | awk '{print $2}'`
}

FILES=()
while read -r -d ''; do
FILES+=("$REPLY")
done < <(find ../packages -name 'hardhat.config.ts' -type f -print0)

# Loop through files and append MD5 to result file
for FILE in ${FILES[@]}; do
echo `checksum_file $FILE` >> $RESULT_FILE
done
# Now sort the file so that it is
sort $RESULT_FILE -o $RESULT_FILE