Skip to content

Commit

Permalink
CI: Use pnpm rather than yarn with Hardhat
Browse files Browse the repository at this point in the history
  • Loading branch information
cameel committed Nov 28, 2023
1 parent e6c2864 commit 7c27237
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ commands:
steps:
- run:
name: Versions
command: npm version
command: |
npm version
yarn --version
pnpm version || >&2 echo "pnpm not installed"
update-npm:
steps:
Expand Down Expand Up @@ -99,7 +102,7 @@ commands:
default: workspace/solc-js.tgz
package-manager:
type: enum
enum: ["npm", "yarn"]
enum: ["npm", "yarn", "pnpm"]
default: npm
steps:
- run:
Expand All @@ -124,7 +127,7 @@ commands:
jq --raw-output .version
)
cd "<<parameters.path>>"
if "<<parameters.package-manager>>" list --pattern solc | grep 'solc@' | grep -v "solc@${solc_version}"; then
if "<<parameters.package-manager>>" list solc | grep 'solc@' | grep -v "solc@${solc_version}"; then
echo "Another version of solc-js is still present in the dependency tree."
exit 1
fi
Expand All @@ -136,11 +139,11 @@ commands:
- install-dependencies:
cache-id: hardhat
path: hardhat
package-manager: yarn
dependency-file: yarn.lock
package-manager: pnpm
dependency-file: pnpm-lock.yaml
- inject-solc-js-tarball:
path: hardhat/
package-manager: yarn
package-manager: pnpm

provision-truffle-with-packaged-solcjs:
description: "Clones Truffle repository and configures it to use a local clone of solc-js."
Expand Down Expand Up @@ -247,17 +250,17 @@ jobs:
hardhat_default_solc_version=$(jq --raw-output '.dependencies.solc' hardhat/packages/hardhat-core/package.json)
mkdir hardhat-default-solc/
pushd hardhat-default-solc/
npm install "solc@${hardhat_default_solc_version}"
pnpm install "solc@${hardhat_default_solc_version}"
popd
ln -sf ../../../hardhat-default-solc/node_modules/solc/soljson.js hardhat/node_modules/solc/soljson.js
- run:
name: Run hardhat-core test suite with its default solc binary
command: |
cd hardhat/packages/hardhat-core
# TODO: yarn build should not be needed to run these tests. Remove it.
# TODO: pnpm build should not be needed to run these tests. Remove it.
# See https://github.com/NomicFoundation/hardhat/issues/2486 for details.
yarn build
yarn test
pnpm build
pnpm test
hardhat-core-latest-solc:
docker:
Expand All @@ -276,7 +279,7 @@ jobs:
export HARDHAT_TESTS_SOLC_PATH HARDHAT_TESTS_SOLC_VERSION
cd packages/hardhat-core/
yarn test
pnpm test
hardhat-sample-project:
docker:
Expand Down

0 comments on commit 7c27237

Please sign in to comment.