From df58e0a6943e9c50f6df6305f85bd95ee3987e9d Mon Sep 17 00:00:00 2001 From: cgewecke Date: Wed, 21 Feb 2024 11:15:30 -0800 Subject: [PATCH] Coerce sources path to absolute path if necessary (#866) --- .circleci/config.yml | 14 ++++++++++++++ plugins/resources/nomiclabs.utils.js | 4 ++++ scripts/nomiclabs.sh | 3 +++ 3 files changed, 21 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index fdb57df5..e0cf73c4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,6 +15,19 @@ step_install_nvm: &step_install_nvm nvm install v18 echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV echo "[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"" >> $BASH_ENV + +step_install_foundry: &step_install_foundry + 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 + curl -L https://foundry.paradigm.xyz | bash + foundryup + jobs: unit-test: docker: @@ -57,6 +70,7 @@ jobs: steps: - checkout - <<: *step_install_nvm + - <<: *step_install_foundry - run: name: Hardhat E2E command: | diff --git a/plugins/resources/nomiclabs.utils.js b/plugins/resources/nomiclabs.utils.js index 110199bb..748e3558 100644 --- a/plugins/resources/nomiclabs.utils.js +++ b/plugins/resources/nomiclabs.utils.js @@ -36,6 +36,10 @@ function normalizeConfig(config, args={}){ ? sources = path.join(config.paths.sources, args.sources) : sources = config.paths.sources; + if (!path.isAbsolute(sources)) { + sources = path.join(config.paths.root, sources); + } + if (config.solidity && config.solidity.compilers.length) { config.viaIR = isUsingViaIR(config.solidity); } diff --git a/scripts/nomiclabs.sh b/scripts/nomiclabs.sh index 6569854c..2fb04082 100755 --- a/scripts/nomiclabs.sh +++ b/scripts/nomiclabs.sh @@ -50,6 +50,9 @@ npm install --silent npm install --save-dev --silent $PR_PATH cat package.json +npx hardhat init-foundry +cat foundry.toml + npx hardhat coverage verifyCoverageExists