Skip to content

Commit

Permalink
Added pnpm (#6148)
Browse files Browse the repository at this point in the history
* Added pnpm

* Removed cache for npm.

* Fixed.

* Added pnpm

* Fixed install script.

* Fixed windows script.

* Fixed.

* Fixed.

* Fixed install.

* Only install direct dependencies.

* Only install direct dependencies.

* Only install direct dependencies.

* Fixed windows build.

* fixed.

* fixed deploy.

* Fixed docker build.

* Fixed windows deploy

* Fixed docker build

* Fixed healthcheck.

* fixed.

* Fixed detection of live plugin managers dependencies.

* fixed.

* Remove Node 19 as it is not supported.

* Fixed.

* Fixed installDeps.sh

* Fixed.

* Fixed windows install.

* Fixed cypress path.

* Fixed.

* Run etherpad in background.

* Install cypress.
  • Loading branch information
SamTV12345 authored Feb 11, 2024
1 parent 96c8190 commit 361b38a
Show file tree
Hide file tree
Showing 28 changed files with 5,804 additions and 10,007 deletions.
102 changes: 79 additions & 23 deletions .github/workflows/backend-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,24 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'npm'
cache-dependency-path: |
src/package-lock.json
src/bin/doc/package-lock.json
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
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: |
Expand All @@ -42,7 +56,7 @@ jobs:
run: src/bin/installDeps.sh
-
name: Run the backend tests
run: cd src && npm test
run: cd src && pnpm test

withpluginsLinux:
# run on pushes to any branch
Expand All @@ -64,10 +78,24 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'npm'
cache-dependency-path: |
src/package-lock.json
src/bin/doc/package-lock.json
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
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: |
Expand All @@ -79,7 +107,7 @@ jobs:
# The --legacy-peer-deps flag is required to work around a bug in npm v7:
# https://github.com/npm/cli/issues/2199
run: >
npm install --no-save --legacy-peer-deps
pnpm install
ep_align
ep_author_hover
ep_cursortrace
Expand Down Expand Up @@ -107,7 +135,7 @@ jobs:
run: src/bin/installDeps.sh
-
name: Run the backend tests
run: cd src && npm test
run: cd src && pnpm test

withoutpluginsWindows:
# run on pushes to any branch
Expand All @@ -125,10 +153,24 @@ 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
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
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 all dependencies and symlink for ep_etherpad-lite
run: src/bin/installOnWindows.bat
Expand All @@ -139,7 +181,7 @@ jobs:
powershell -Command "(gc settings.json.holder) -replace '\"points\": 10', '\"points\": 1000' | Out-File -encoding ASCII settings.json"
-
name: Run the backend tests
run: cd src && npm test
run: cd src && pnpm test

withpluginsWindows:
# run on pushes to any branch
Expand All @@ -157,17 +199,31 @@ 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-version: 21
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
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 Etherpad plugins
# The --legacy-peer-deps flag is required to work around a bug in npm
# v7: https://github.com/npm/cli/issues/2199
run: >
npm install --no-save --legacy-peer-deps
pnpm install
ep_align
ep_author_hover
ep_cursortrace
Expand Down Expand Up @@ -200,4 +256,4 @@ jobs:
powershell -Command "(gc settings.json.holder) -replace '\"points\": 10', '\"points\": 1000' | Out-File -encoding ASCII settings.json"
-
name: Run the backend tests
run: cd src && npm test
run: cd src && pnpm test
26 changes: 19 additions & 7 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,28 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
cache-dependency-path: |
src/package-lock.json
src/bin/doc/package-lock.json
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
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: Test
run: |
docker run --rm -d -p 9001:9001 --name test ${{ env.TEST_TAG }}
docker logs -f test &
./src/bin/installDeps.sh
docker logs -f test &
while true; do
echo "Waiting for Docker container to start..."
status=$(docker container inspect -f '{{.State.Health.Status}}' test) || exit 1
Expand All @@ -58,7 +70,7 @@ jobs:
*) printf %s\\n "unexpected status: ${status}" >&2; exit 1;;
esac
done
(cd src && npm run test-container)
(cd src && pnpm run test-container)
git clean -dxf .
-
name: Docker meta
Expand Down Expand Up @@ -96,4 +108,4 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: etherpad/etherpad
enable-url-completion: true
enable-url-completion: true
26 changes: 20 additions & 6 deletions .github/workflows/frontend-admin-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [19, 20, 21]
node: [20, 21]

steps:
-
Expand All @@ -32,16 +32,30 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'npm'
cache-dependency-path: |
src/package-lock.json
src/bin/doc/package-lock.json
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
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 etherpad plugins
# We intentionally install an old ep_align version to test upgrades to
# the minor version number. The --legacy-peer-deps flag is required to
# work around a bug in npm v7: https://github.com/npm/cli/issues/2199
run: npm install --no-save --legacy-peer-deps [email protected]
run: pnpm install [email protected]
# 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
Expand Down
46 changes: 36 additions & 10 deletions .github/workflows/frontend-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,25 @@ 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-version: 21
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
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 all dependencies and symlink for ep_etherpad-lite
run: src/bin/installDeps.sh
Expand Down Expand Up @@ -81,16 +95,28 @@ 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
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
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: Install Etherpad plugins
# The --legacy-peer-deps flag is required to work around a bug in npm v7:
# https://github.com/npm/cli/issues/2199
run: >
npm install --no-save --legacy-peer-deps
pnpm install
ep_align
ep_author_hover
ep_cursortrace
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/lint-package-lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ 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
-
name: Install lockfile-lint
run: npm install --no-save lockfile-lint --legacy-peer-deps
-
name: Run lockfile-lint on package-lock.json
run: >
Expand Down
Loading

0 comments on commit 361b38a

Please sign in to comment.