Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try pnpm #37324

Closed
wants to merge 9 commits into from
Closed

Try pnpm #37324

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
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

## Checklist:
- [ ] My code is tested.
- [ ] My code follows the WordPress code style. <!-- Check code: `npm run lint`, Guidelines: https://developer.wordpress.org/coding-standards/wordpress-coding-standards/javascript/ -->
- [ ] My code follows the WordPress code style. <!-- Check code: `pnpm lint`, Guidelines: https://developer.wordpress.org/coding-standards/wordpress-coding-standards/javascript/ -->
- [ ] My code follows the accessibility standards. <!-- Guidelines: https://developer.wordpress.org/coding-standards/wordpress-coding-standards/accessibility/ -->
- [ ] I've tested my changes with keyboard and screen readers. <!-- Instructions: https://github.com/WordPress/gutenberg/blob/HEAD/docs/contributors/accessibility-testing.md -->
- [ ] My code has proper inline documentation. <!-- Guidelines: https://developer.wordpress.org/coding-standards/inline-documentation-standards/javascript/ -->
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/build-plugin-zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,15 @@ jobs:
with:
ref: ${{ needs.bump-version.outputs.release_branch || github.ref }}

- uses: pnpm/action-setup@v2.0.1
with:
version: 6.23.6

- name: Use desired version of NodeJS
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f # v2.2.2
uses: actions/setup-node@v2
with:
node-version: 14
cache: npm
cache: pnpm

- name: Build Gutenberg plugin ZIP file
run: ./bin/build-plugin-zip.sh
Expand All @@ -193,7 +197,7 @@ jobs:
run: |
IFS='.' read -r -a VERSION_ARRAY <<< "${VERSION}"
MILESTONE="Gutenberg ${VERSION_ARRAY[0]}.${VERSION_ARRAY[1]}"
npm run changelog -- --milestone="$MILESTONE" --unreleased > release-notes.txt
pnpm changelog -- --milestone="$MILESTONE" --unreleased > release-notes.txt
sed -ie '1,6d' release-notes.txt
if [[ ${{ needs.bump-version.outputs.new_version }} != *"rc"* ]]; then
# Include previous RCs' release notes, if any
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/bundle-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ jobs:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
with:
fetch-depth: 1

- uses: pnpm/action-setup@v2.0.1
with:
version: 6.23.6
- name: Use desired version of NodeJS
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f # v2.2.2
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: npm
cache: pnpm

- uses: preactjs/compressed-size-action@df6e03e187079aef959a2878311639c77b95ee2e # v2.2.0
with:
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/create-block.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ jobs:

steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4

- uses: pnpm/action-setup@v2.0.1
with:
version: 6.23.6
- name: Use desired version of NodeJS
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f # v2.2.2
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: npm
cache: pnpm

- name: npm install, build, format and lint
- name: pnpm install, build, format and lint
run: |
npm ci
npm run test:create-block
pnpm install
ppnpm test:create-block
14 changes: 8 additions & 6 deletions .github/workflows/end2end-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,23 @@ jobs:

steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4

- uses: pnpm/action-setup@v2.0.1
with:
version: 6.23.6
- name: Use desired version of NodeJS
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f # v2.2.2
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: npm
cache: pnpm

- name: Npm install and build
run: |
npm ci
npm run build
pnpm install
pnpm build

- name: Install WordPress
run: |
npm run wp-env start
pnpm wp-env start

- name: Running the tests
run: |
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/flaky-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,18 @@ jobs:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4

- uses: pnpm/action-setup@v2.0.1
with:
version: 6.23.6
- name: Use desired version of NodeJS
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f # v2.2.2
uses: actions/setup-node@v2
with:
node-version: 14
cache: npm
cache: pnpm

- name: Npm install
- name: Pnpm install
run: |
npm ci
pnpm install

- name: Report flaky tests
uses: ./.github/report-flaky-tests
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,18 @@ jobs:

steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4

- uses: pnpm/action-setup@v2.0.1
with:
version: 6.23.6
- name: Use desired version of NodeJS
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f # v2.2.2
uses: actions/setup-node@v2
with:
node-version: 14
cache: npm
cache: pnpm

- name: Npm install
- name: Pnpm install
run: |
npm ci
pnpm install

- name: Compare performance with trunk
if: github.event_name == 'pull_request'
Expand Down
21 changes: 7 additions & 14 deletions .github/workflows/pull-request-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,17 @@ jobs:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
with:
ref: trunk

- uses: pnpm/action-setup@v2.0.1
with:
version: 6.23.6
- name: Use desired version of NodeJS
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f # v2.2.2
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: pnpm

- name: Cache NPM packages
uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # v2.1.6
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.node }}-npm-pr-automation-cache-${{ hashFiles('**/package-lock.json') }}

# Changing into the action's directory and running `npm install` is much
# faster than a full project-wide `npm ci`.
- name: Install NPM dependencies
run: npm install
working-directory: packages/project-management-automation
- name: Install pnpm dependencies
run: pnpm install

- uses: ./packages/project-management-automation
with:
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/rnmobile-android-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4

- uses: pnpm/action-setup@v2.0.1
with:
version: 6.23.6
- name: Use desired version of NodeJS
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f # v2.2.2
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: npm
cache: pnpm

- run: npm ci
- run: pnpm install

- name: Restore Gradle cache
uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # v2.1.6
Expand All @@ -44,7 +46,7 @@ jobs:
api-level: 28
emulator-build: 7425822 # https://git.io/JE3jX
profile: pixel_xl
script: npm run native test:e2e:android:local ${{ matrix.native-test-name }}
script: pnpm native test:e2e:android:local ${{ matrix.native-test-name }}

- uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2
if: always()
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/rnmobile-ios-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@ jobs:

steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4

- uses: pnpm/action-setup@v2.0.1
with:
version: 6.23.6
- name: Use desired version of NodeJS
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f # v2.2.2
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: npm
cache: pnpm

- run: npm ci
- run: pnpm install

- name: Prepare build cache key
run: find package-lock.json packages/react-native-editor/ios packages/react-native-aztec/ios packages/react-native-bridge/ios -type f -print0 | sort -z | xargs -0 shasum | tee ios-checksums.txt
Expand All @@ -56,22 +58,22 @@ jobs:
key: ${{ runner.os }}-pods-${{ hashFiles('packages/react-native-editor/ios/Gemfile.lock') }}-${{ hashFiles('packages/react-native-editor/ios/Podfile.lock') }}-${{ hashFiles('package-lock.json') }}

- name: Bundle iOS
run: npm run native test:e2e:bundle:ios
run: pnpm native test:e2e:bundle:ios

- name: Switch Xcode version to ${{ matrix.xcode }}
run: sudo xcode-select --switch /Applications/Xcode_${{ matrix.xcode }}.app

- name: Build (if needed)
run: test -e packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app/GutenbergDemo || npm run native test:e2e:build-app:ios
run: test -e packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app/GutenbergDemo || pnpm native test:e2e:build-app:ios

- name: Build Web Driver Agent (if needed)
run: test -d packages/react-native-editor/ios/build/WDA || npm run native test:e2e:build-wda
run: test -d packages/react-native-editor/ios/build/WDA || pnpm native test:e2e:build-wda

- name: Force update Launch Database to prevent issues when opening the Simulator app
run: /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -f /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer/Applications/Simulator.app

- name: Run iOS Device Tests
run: TEST_RN_PLATFORM=ios npm run native device-tests:local ${{ matrix.native-test-name }}
run: TEST_RN_PLATFORM=ios pnpm native device-tests:local ${{ matrix.native-test-name }}

- name: Prepare build cache
run: |
Expand Down
22 changes: 10 additions & 12 deletions .github/workflows/static-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,26 @@ jobs:

steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4

- uses: pnpm/action-setup@v2.0.1
with:
version: 6.23.6
- name: Use desired version of NodeJS
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f # v2.2.2
uses: actions/setup-node@v2
with:
node-version: 14
cache: npm
cache: pnpm

- name: Npm install
# A "full" install is executed, since `npm ci` does not always exit
# with an error status code if the lock file is inaccurate.
#
# See: https://github.com/WordPress/gutenberg/issues/16157
run: npm install
run: pnpm install

- name: Lint JavaScript and Styles
run: npm run lint
run: pnpm lint

- name: Type checking
run: npm run build:package-types
run: pnpm build:package-types

- name: Check local changes
run: npm run check-local-changes
run: pnpm check-local-changes

- name: License compatibility
run: npm run check-licenses
run: pnpm check-licenses
12 changes: 7 additions & 5 deletions .github/workflows/storybook-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,20 @@ jobs:
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
with:
ref: trunk

- uses: pnpm/action-setup@v2.0.1
with:
version: 6.23.6
- name: Use desired version of NodeJS
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f # v2.2.2
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: npm
cache: pnpm

- name: Install Dependencies
run: npm ci
run: pnpm install

- name: Build Storybook
run: npm run storybook:build
run: pnpm storybook:build

- name: Deploy
uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3
Expand Down
Loading