From 7f710c4ecd3911a44231272420a1be02ea2aec08 Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Thu, 15 Feb 2024 09:07:12 +0100 Subject: [PATCH 1/6] fixed. --- .github/workflows/backend-tests.yml | 30 +++++++++++----- .github/workflows/frontend-tests.yml | 25 +++++++++---- .github/workflows/npmpublish.yml | 54 +++++++++++++++++++--------- 3 files changed, 76 insertions(+), 33 deletions(-) diff --git a/.github/workflows/backend-tests.yml b/.github/workflows/backend-tests.yml index 85029bf..eea32e9 100644 --- a/.github/workflows/backend-tests.yml +++ b/.github/workflows/backend-tests.yml @@ -14,6 +14,24 @@ jobs: runs-on: ubuntu-latest steps: + - + uses: pnpm/action-setup@v3 + name: Install pnpm + with: + version: 8 + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + - uses: actions/cache@v4 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + - name: Only install direct dependencies + run: pnpm config set auto-install-peers false - name: Install libreoffice run: | @@ -25,6 +43,7 @@ jobs: uses: actions/checkout@v4 with: repository: ether/etherpad-lite + ref: develop - name: Checkout plugin repository uses: actions/checkout@v4 @@ -46,18 +65,11 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20 - cache: 'npm' - cache-dependency-path: | - src/package-lock.json - src/bin/doc/package-lock.json - node_modules/${{ steps.plugin_name.outputs.plugin_name }}/package-lock.json - - run: npm install npm@6.14.18 -g - name: Install legacy npm for correct dependency resolution - name: Install plugin dependencies run: | cd ./node_modules/"${PLUGIN_NAME}" - npm ci + pnpm i env: PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }} # Etherpad core dependencies must be installed after installing the @@ -74,4 +86,4 @@ jobs: run: src/bin/installDeps.sh - name: Run the backend tests - run: cd src && npm test + run: cd src && pnpm test diff --git a/.github/workflows/frontend-tests.yml b/.github/workflows/frontend-tests.yml index 58dd011..cbf199b 100644 --- a/.github/workflows/frontend-tests.yml +++ b/.github/workflows/frontend-tests.yml @@ -25,12 +25,23 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20 - cache: 'npm' - cache-dependency-path: | - src/package-lock.json - src/bin/doc/package-lock.json - - run: npm install npm@6.14.18 -g - name: Install legacy npm for correct dependency resolution + - uses: pnpm/action-setup@v3 + name: Install pnpm + with: + version: 8 + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + - uses: actions/cache@v4 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + - name: Only install direct dependencies + run: pnpm config set auto-install-peers false - name: Check out the plugin uses: actions/checkout@v4 @@ -60,7 +71,7 @@ jobs: PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }} run: | cd ./node_modules/"${PLUGIN_NAME}" - npm ci + pnpm i # Etherpad core dependencies must be installed after installing the # plugin's dependencies, otherwise npm will try to hoist common # dependencies by removing them from src/node_modules and installing them diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml index 0bcfc36..ca0fdce 100644 --- a/.github/workflows/npmpublish.yml +++ b/.github/workflows/npmpublish.yml @@ -43,13 +43,21 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20 - cache: 'npm' - cache-dependency-path: | - node_modules/ep_etherpad-lite/package-lock.json - node_modules/ep_etherpad-lite/bin/doc/package-lock.json - package-lock.json - - run: npm install npm@6.14.18 -g - name: Install legacy npm for correct dependency resolution + - uses: pnpm/action-setup@v3 + name: Install pnpm + with: + version: 8 + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + - uses: actions/cache@v4 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- # All of ep_etherpad-lite's devDependencies are installed because the # plugin might do `require('ep_etherpad-lite/node_modules/${devDep}')`. # Eventually it would be nice to create an ESLint plugin that prohibits @@ -57,9 +65,9 @@ jobs: # devDependencies. If we had that, we could change this line to only # install production dependencies. - - run: cd ../etherpad-lite/src && npm ci + run: cd ../etherpad-lite/src && pnpm i - - run: npm ci + run: pnpm i # This runs some sanity checks and creates a symlink at # node_modules/ep_etherpad-lite that points to ../../etherpad-lite/src. # This step must be done after `npm ci` installs the plugin's dependencies @@ -67,11 +75,11 @@ jobs: # ep_etherpad-lite in the plugin's node_modules prevents lint errors and # unit test failures if the plugin does `require('ep_etherpad-lite/foo')`. - - run: npm install --no-save ep_etherpad-lite@file:../etherpad-lite/src + run: pnpm install --no-save ep_etherpad-lite@file:../etherpad-lite/src - - run: npm test + run: pnpm test - - run: npm run lint + run: pnpm run lint publish-npm: if: github.event_name == 'push' @@ -87,9 +95,21 @@ jobs: with: node-version: 20 registry-url: https://registry.npmjs.org/ - cache: 'npm' - - run: npm install npm@6.14.18 -g - name: Install legacy npm for correct dependency resolution + - uses: pnpm/action-setup@v3 + name: Install pnpm + with: + version: 8 + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + - uses: actions/cache@v4 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- - name: Bump version (patch) run: | @@ -98,13 +118,13 @@ jobs: [ "${NEW_COMMITS}" -gt 0 ] || exit 0 git config user.name 'github-actions[bot]' git config user.email '41898282+github-actions[bot]@users.noreply.github.com' - npm ci + pnpm i npm version patch git push --follow-tags # This is required if the package has a prepare script that uses something # in dependencies or devDependencies. - - run: npm ci + run: pnpm i # `npm publish` must come after `git push` otherwise there is a race # condition: If two PRs are merged back-to-back then master/main will be # updated with the commits from the second PR before the first PR's From 982efdcaf56447d72a387a1fcf1dd3d0bb84d176 Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Thu, 15 Feb 2024 09:08:29 +0100 Subject: [PATCH 2/6] fixed. --- .github/workflows/backend-tests.yml | 6 +++--- .github/workflows/frontend-tests.yml | 6 +++--- .github/workflows/npmpublish.yml | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/backend-tests.yml b/.github/workflows/backend-tests.yml index eea32e9..7e7e36e 100644 --- a/.github/workflows/backend-tests.yml +++ b/.github/workflows/backend-tests.yml @@ -23,9 +23,9 @@ jobs: shell: bash run: | echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - uses: actions/cache@v4 - name: Setup pnpm cache - with: + - uses: actions/cache@v4 + name: Setup pnpm cache + with: path: ${{ env.STORE_PATH }} key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | diff --git a/.github/workflows/frontend-tests.yml b/.github/workflows/frontend-tests.yml index cbf199b..2f1466f 100644 --- a/.github/workflows/frontend-tests.yml +++ b/.github/workflows/frontend-tests.yml @@ -33,9 +33,9 @@ jobs: shell: bash run: | echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - uses: actions/cache@v4 - name: Setup pnpm cache - with: + - uses: actions/cache@v4 + name: Setup pnpm cache + with: path: ${{ env.STORE_PATH }} key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml index ca0fdce..d92cc9f 100644 --- a/.github/workflows/npmpublish.yml +++ b/.github/workflows/npmpublish.yml @@ -51,9 +51,9 @@ jobs: shell: bash run: | echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - uses: actions/cache@v4 - name: Setup pnpm cache - with: + - uses: actions/cache@v4 + name: Setup pnpm cache + with: path: ${{ env.STORE_PATH }} key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | From 652626709bb9c3b6b1de5befb981dd04d70361fc Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Thu, 15 Feb 2024 09:11:48 +0100 Subject: [PATCH 3/6] Fixed. --- .github/workflows/npmpublish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml index d92cc9f..8a48afc 100644 --- a/.github/workflows/npmpublish.yml +++ b/.github/workflows/npmpublish.yml @@ -58,6 +58,8 @@ jobs: key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-pnpm-store- + - name: Only install direct dependencies + run: pnpm config set auto-install-peers false # All of ep_etherpad-lite's devDependencies are installed because the # plugin might do `require('ep_etherpad-lite/node_modules/${devDep}')`. # Eventually it would be nice to create an ESLint plugin that prohibits From 904173734ee6ea0f0d0fe206f83edf9425a32a7b Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Thu, 15 Feb 2024 09:13:29 +0100 Subject: [PATCH 4/6] Fixed. --- .github/workflows/npmpublish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml index 8a48afc..57c8013 100644 --- a/.github/workflows/npmpublish.yml +++ b/.github/workflows/npmpublish.yml @@ -77,7 +77,7 @@ jobs: # ep_etherpad-lite in the plugin's node_modules prevents lint errors and # unit test failures if the plugin does `require('ep_etherpad-lite/foo')`. - - run: pnpm install --no-save ep_etherpad-lite@file:../etherpad-lite/src + run: pnpm install ep_etherpad-lite@file:../etherpad-lite/src - run: pnpm test - From 2ffb176a342663ced56aa99f9eadff6e3758ee60 Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Thu, 15 Feb 2024 09:14:14 +0100 Subject: [PATCH 5/6] Fixed. --- .github/workflows/npmpublish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml index 57c8013..db5ab95 100644 --- a/.github/workflows/npmpublish.yml +++ b/.github/workflows/npmpublish.yml @@ -112,6 +112,8 @@ jobs: key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-pnpm-store- + - name: Only install direct dependencies + run: pnpm config set auto-install-peers false - name: Bump version (patch) run: | From 4e3699a9a6c9a52ea9d54159826f8e01ec92d1f2 Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Thu, 15 Feb 2024 09:16:59 +0100 Subject: [PATCH 6/6] Show current dir. --- .github/workflows/npmpublish.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml index db5ab95..04a84c2 100644 --- a/.github/workflows/npmpublish.yml +++ b/.github/workflows/npmpublish.yml @@ -79,7 +79,10 @@ jobs: - run: pnpm install ep_etherpad-lite@file:../etherpad-lite/src - - run: pnpm test + run: | + ls -lisa + pwd + pnpm run test - run: pnpm run lint