You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.1 KiB
45 lines
1.1 KiB
5 years ago
|
#!/usr/bin/env bash
|
||
|
#
|
||
4 years ago
|
# E2E CI: installs PR candidate on openzeppelin-contracts and runs coverage
|
||
5 years ago
|
#
|
||
|
|
||
5 years ago
|
set -o errexit
|
||
|
|
||
5 years ago
|
# Get rid of any caches
|
||
5 years ago
|
sudo rm -rf node_modules
|
||
5 years ago
|
echo "NVM CURRENT >>>>>" && nvm current
|
||
5 years ago
|
|
||
5 years ago
|
# Use PR env variables (for forks) or fallback on local if PR not available
|
||
|
SED_REGEX="s/git@github.com:/https:\/\/github.com\//"
|
||
5 years ago
|
|
||
5 years ago
|
if [[ -v CIRCLE_PR_REPONAME ]]; then
|
||
|
PR_PATH="https://github.com/$CIRCLE_PR_USERNAME/$CIRCLE_PR_REPONAME#$CIRCLE_SHA1"
|
||
|
else
|
||
|
PR_PATH=$(echo "$CIRCLE_REPOSITORY_URL#$CIRCLE_SHA1" | sudo sed "$SED_REGEX")
|
||
|
fi
|
||
5 years ago
|
|
||
5 years ago
|
echo "PR_PATH >>>>> $PR_PATH"
|
||
5 years ago
|
|
||
4 years ago
|
# Install Zeppelin
|
||
|
git clone https://github.com/OpenZeppelin/openzeppelin-contracts.git
|
||
5 years ago
|
cd openzeppelin-contracts
|
||
5 years ago
|
|
||
5 years ago
|
# Swap installed coverage for PR branch version
|
||
4 years ago
|
echo ">>>>> npm install"
|
||
|
npm install
|
||
|
|
||
1 year ago
|
# Use HH latest
|
||
|
npm install hardhat@latest --save-dev
|
||
2 years ago
|
|
||
4 years ago
|
echo ">>>>> npm uninstall solidity-coverage --save-dev"
|
||
|
npm uninstall solidity-coverage --save-dev
|
||
5 years ago
|
|
||
4 years ago
|
echo ">>>>> npm add $PR_PATH --dev"
|
||
|
npm install "$PR_PATH" --save-dev
|
||
5 years ago
|
|
||
4 years ago
|
echo ">>>>> cat package.json"
|
||
|
cat package.json
|
||
5 years ago
|
|
||
5 years ago
|
# Track perf
|
||
4 years ago
|
CI=false npm run coverage
|