Skip to content

Commit

Permalink
Merge pull request #4568 from NomicFoundation/feature/3521-replace-pk…
Browse files Browse the repository at this point in the history
…g-manager-yarn-with-pnpm

Replace yarn with pnpm
  • Loading branch information
fvictorio authored Nov 14, 2023
2 parents a6ea606 + 8957574 commit ba073b9
Show file tree
Hide file tree
Showing 99 changed files with 26,772 additions and 25,029 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

version: 2
updates:
- package-ecosystem: "npm"
- package-ecosystem: "pnpm"
directory: "/"
schedule:
interval: "daily"
Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/LATEST_DEPENDENCY_VERSIONS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,32 @@ on:
workflow_dispatch:

jobs:
test-without-yarn-lock:
name: Test without yarn.lock
test-without-pnpm-lock-yaml:
name: Test without pnpm-lock.yaml
strategy:
matrix:
system: ["ubuntu-latest", "windows-latest"]
runs-on: ${{ matrix.system }}
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v2
with:
node-version: 16
- uses: actions/checkout@v2
- name: Delete yarn.lock
run: "rm yarn.lock"
cache: "pnpm"
- name: Delete pnpm-lock.yaml
run: "rm pnpm-lock.yaml"
- name: Install
run: yarn
run: pnpm install --no-frozen-lockfile
- name: List dependencies
run: yarn list
run: pnpm list -r --depth 2
- name: Run tests
env:
DO_NOT_SET_THIS_ENV_VAR____IS_HARDHAT_CI: true
FORCE_COLOR: 3
run: yarn test || (echo "===== Retry =====" && yarn test)
run: pnpm test || (echo "===== Retry =====" && pnpm test)
- name: Notify failures
if: failure()
uses: slackapi/[email protected]
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/check-docs-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v2
with:
node-version: 16
cache: yarn
cache: "pnpm"
- name: Install
run: yarn --frozen-lockfile
run: pnpm install --frozen-lockfile --prefer-offline
- name: Install Docs
run: cd docs && yarn
run: cd docs && pnpm install --frozen-lockfile --prefer-offline
- name: lint
run: cd docs && yarn lint
run: cd docs && pnpm lint
- name: Build
run: cd docs && yarn build
run: cd docs && pnpm build
- name: Storybook
run: cd docs && yarn build-storybook
run: cd docs && pnpm build-storybook
17 changes: 10 additions & 7 deletions .github/workflows/comment-on-linter-error.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,27 @@ jobs:
uses: actions/checkout@v2
with:
ref: "refs/pull/${{ github.event.number }}/merge"
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v2
with:
node-version: 16
cache: yarn
cache: "pnpm"
- name: Install
run: yarn --frozen-lockfile
run: pnpm install --frozen-lockfile --prefer-offline
- name: Build
run: yarn build
run: pnpm build
- name: lint
run: yarn lint
run: pnpm lint
- name: Check dependency versions
run: node scripts/check-dependencies.js
- name: Install website
working-directory: docs/
run: yarn
run: pnpm install --frozen-lockfile --prefer-offline
- name: Lint website
working-directory: docs/
run: yarn lint
run: pnpm lint
- uses: actions/github-script@v6
name: Comment on failure
if: ${{ failure() }}
Expand All @@ -47,5 +50,5 @@ jobs:
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "Thanks for submitting this PR!\n\nUnfortunately, it has some linter errors, so we can't merge it yet. Can you please fix them?\n\nRunning yarn `lint:fix` in the root of the repository may fix them automatically."
body: "Thanks for submitting this PR!\n\nUnfortunately, it has some linter errors, so we can't merge it yet. Can you please fix them?\n\nRunning pnpm lint:fix in the root of the repository may fix them automatically."
})
8 changes: 6 additions & 2 deletions .github/workflows/compile-with-typescript-v4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v2
with:
node-version: 16
cache: "pnpm"
- name: Install typescript v4 in all packages
run: |
sed -i 's/"typescript": "~5.0.0"/"typescript": "^4.0.0"/' package.json packages/*/package.json && yarn
sed -i 's/"typescript": "~5.0.0"/"typescript": "^4.0.0"/' package.json packages/*/package.json && pnpm install --no-frozen-lockfile
# hardhat-viem is the only package that requires TypeScript v5
- name: Remove hardhat-viem directory
run: rm -fr packages/hardhat-viem
- name: Remove hardhat-viem from the build script
run: sed -i 's/packages\/hardhat-viem packages\/hardhat-toolbox-viem//' package.json
- name: Build
run: yarn build
run: pnpm build
33 changes: 21 additions & 12 deletions .github/workflows/hardhat-chai-matchers-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,21 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v2
with:
node-version: 16
cache: yarn
cache: "pnpm"
- name: Install
run: yarn --frozen-lockfile
run: pnpm install --frozen-lockfile --prefer-offline
- name: Build
run: yarn build
run: pnpm build
- name: Run tests
env:
FORCE_COLOR: 3
run: yarn test:ci
run: pnpm test:ci

test_on_macos:
name: Test hardhat-chai-matchers on MacOS with Node 16
Expand All @@ -50,18 +53,21 @@ jobs:
if: ${{ false }}
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v2
with:
node-version: 16
cache: yarn
cache: "pnpm"
- name: Install
run: yarn --frozen-lockfile
run: pnpm install --frozen-lockfile --prefer-offline
- name: Build
run: yarn build
run: pnpm build
- name: Run tests
env:
FORCE_COLOR: 3
run: yarn test:ci
run: pnpm test:ci

test_on_linux:
name: Test hardhat-chai-matchers on Ubuntu with Node ${{ matrix.node }}
Expand All @@ -71,15 +77,18 @@ jobs:
node: [16, 18, 20]
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: yarn
cache: "pnpm"
- name: Install
run: yarn --frozen-lockfile
run: pnpm install --frozen-lockfile --prefer-offline
- name: Build
run: yarn build
run: pnpm build
- name: Run tests
env:
FORCE_COLOR: 3
run: yarn test:ci
run: pnpm test:ci
46 changes: 29 additions & 17 deletions .github/workflows/hardhat-core-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,22 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v2
with:
node-version: 16
cache: yarn
cache: "pnpm"
- name: Install
run: yarn --frozen-lockfile
run: pnpm install --frozen-lockfile --prefer-offline
- name: Build
run: yarn build
run: pnpm build
- name: Run tests
env:
DO_NOT_SET_THIS_ENV_VAR____IS_HARDHAT_CI: true
FORCE_COLOR: 3
run: yarn test:except-tracing
run: pnpm test:except-tracing

test_on_macos:
name: Test hardhat-core on MacOS with Node 16
Expand All @@ -51,19 +54,22 @@ jobs:
if: ${{ false }}
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v2
with:
node-version: 16
cache: yarn
cache: "pnpm"
- name: Install
run: yarn --frozen-lockfile
run: pnpm install --frozen-lockfile --prefer-offline
- name: Build
run: yarn build
run: pnpm build
- name: Run tests
env:
DO_NOT_SET_THIS_ENV_VAR____IS_HARDHAT_CI: true
FORCE_COLOR: 3
run: yarn test:except-tracing
run: pnpm test:except-tracing

test_on_linux:
name: Test hardhat-core on Ubuntu with Node ${{ matrix.node }}
Expand All @@ -73,19 +79,22 @@ jobs:
node: [16, 18, 20]
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: yarn
cache: "pnpm"
- name: Install
run: yarn --frozen-lockfile
run: pnpm install --frozen-lockfile --prefer-offline
- name: Build
run: yarn build
run: pnpm build
- name: Run tests
env:
DO_NOT_SET_THIS_ENV_VAR____IS_HARDHAT_CI: true
FORCE_COLOR: 3
run: yarn test:except-tracing
run: pnpm test:except-tracing

test_types_node:
name: Test different versions of @types/node
Expand All @@ -95,18 +104,21 @@ jobs:
node: [16, 18, 20]
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: yarn
cache: "pnpm"
- name: Install
run: yarn --frozen-lockfile
run: pnpm install --frozen-lockfile --prefer-offline
- name: Install @types/node
run: yarn add --dev @types/node@${{ matrix.node }}
run: pnpm add --save-dev @types/node@${{ matrix.node }}
- name: Build
run: yarn build
run: pnpm build
- name: Run tests
env:
DO_NOT_SET_THIS_ENV_VAR____IS_HARDHAT_CI: true
FORCE_COLOR: 3
run: yarn test:except-tracing
run: pnpm test:except-tracing
33 changes: 21 additions & 12 deletions .github/workflows/hardhat-ethers-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,19 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v2
with:
node-version: 16
cache: yarn
cache: "pnpm"
- name: Install
run: yarn --frozen-lockfile
run: pnpm install --frozen-lockfile --prefer-offline
- name: Build
run: yarn build
run: pnpm build
- name: Run tests
run: yarn test
run: pnpm test

test_on_macos:
name: Test hardhat-ethers on MacOS with Node 16
Expand All @@ -50,16 +53,19 @@ jobs:
if: ${{ false }}
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v2
with:
node-version: 16
cache: yarn
cache: "pnpm"
- name: Install
run: yarn --frozen-lockfile
run: pnpm install --frozen-lockfile --prefer-offline
- name: Build
run: yarn build
run: pnpm build
- name: Run tests
run: yarn test
run: pnpm test

test_on_linux:
name: Test hardhat-ethers on Ubuntu with Node ${{ matrix.node }}
Expand All @@ -69,13 +75,16 @@ jobs:
node: [16, 18, 20]
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: yarn
cache: "pnpm"
- name: Install
run: yarn --frozen-lockfile
run: pnpm install --frozen-lockfile --prefer-offline
- name: Build
run: yarn build
run: pnpm build
- name: Run tests
run: yarn test
run: pnpm test
Loading

0 comments on commit ba073b9

Please sign in to comment.