From 7049372f4ae1250aa87dda86731e30b9155c352f Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Sat, 10 Feb 2024 16:21:03 +0100 Subject: [PATCH] Fixed windows build. --- .github/workflows/backend-tests.yml | 8 ++++---- .github/workflows/docker.yml | 2 +- .../workflows/upgrade-from-latest-release.yml | 2 +- .github/workflows/windows.yml | 2 +- .gitignore | 3 ++- .travis.yml | 18 +++++++++--------- Dockerfile | 2 +- src/bin/buildForWindows.sh | 2 +- src/bin/plugins/lib/README.md | 2 +- src/bin/plugins/lib/backend-tests.yml | 2 +- 10 files changed, 22 insertions(+), 21 deletions(-) diff --git a/.github/workflows/backend-tests.yml b/.github/workflows/backend-tests.yml index 5c0a176b6..21cb83e6b 100644 --- a/.github/workflows/backend-tests.yml +++ b/.github/workflows/backend-tests.yml @@ -56,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 @@ -135,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 @@ -181,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 @@ -256,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 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 6b92be544..cb5465121 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -70,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 diff --git a/.github/workflows/upgrade-from-latest-release.yml b/.github/workflows/upgrade-from-latest-release.yml index 12a383f5d..dbdfe4fcc 100644 --- a/.github/workflows/upgrade-from-latest-release.yml +++ b/.github/workflows/upgrade-from-latest-release.yml @@ -80,7 +80,7 @@ jobs: run: src/bin/installDeps.sh - name: Run the backend tests - run: cd src && npm test + run: cd src && pnpm test # Because actions/checkout@v4 is called with "ref: master" and without # "fetch-depth: 0", the local clone does not have the ${GITHUB_SHA} # commit. Fetch ${GITHUB_REF} to get the ${GITHUB_SHA} commit. Note that a diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index cfa11c779..57b907bd6 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -54,7 +54,7 @@ jobs: - name: Run the backend tests shell: msys2 {0} - run: cd src && npm test + run: cd src && pnpm test - name: Build the .zip shell: msys2 {0} diff --git a/.gitignore b/.gitignore index 6c94cbad2..cb81fbc85 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,5 @@ out/ /src/bin/convertSettings.json /src/bin/etherpad-1.deb /src/bin/node.exe -plugin_packages \ No newline at end of file +plugin_packages +/pnpm-lock.yaml \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 44a8693bb..f142e51b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,21 +64,21 @@ jobs: - *install_libreoffice - *set_loglevel_warn - "src/bin/installDeps.sh" - - "cd src && npm install && cd -" + - "cd src && pnpm install && cd -" script: - - "cd src && npm test" + - "cd src && pnpm test" - name: "Test the Dockerfile" install: - - "cd src && npm install && cd -" + - "cd src && pnpm install && cd -" script: - "docker build -t etherpad:test ." - "docker run -d -p 9001:9001 etherpad:test && sleep 3" - - "cd src && npm run test-container" + - "cd src && pnpm run test-container" - name: "Load test Etherpad without Plugins" install: - *set_loglevel_warn - "src/bin/installDeps.sh" - - "cd src && npm install && cd -" + - "cd src && pnpm install && cd -" - "npm install -g etherpad-load-test" script: - "src/tests/frontend/travis/runnerLoadTest.sh" @@ -107,16 +107,16 @@ jobs: - *set_loglevel_warn - "src/bin/installDeps.sh" - *install_plugins - - "cd src && npm install && cd -" + - "cd src && pnpm install && cd -" script: - - "cd src && npm test" + - "cd src && pnpm test" - name: "Test the Dockerfile" install: - - "cd src && npm install && cd -" + - "cd src && pnpm install && cd -" script: - "docker build -t etherpad:test ." - "docker run -d -p 9001:9001 etherpad:test && sleep 3" - - "cd src && npm run test-container" + - "cd src && pnpm run test-container" - name: "Load test Etherpad with Plugins" install: - *set_loglevel_warn diff --git a/Dockerfile b/Dockerfile index 3bf09c4e8..c29813090 100644 --- a/Dockerfile +++ b/Dockerfile @@ -113,7 +113,7 @@ COPY --chown=etherpad:etherpad ${SETTINGS} "${EP_DIR}"/settings.json #RUN chmod -R g=u . USER root -RUN cd src && npm link +RUN cd src && pnpm link USER etherpad diff --git a/src/bin/buildForWindows.sh b/src/bin/buildForWindows.sh index ef4512305..a1c8ca2dc 100755 --- a/src/bin/buildForWindows.sh +++ b/src/bin/buildForWindows.sh @@ -33,7 +33,7 @@ try export GIT_WORK_TREE=${TMP_FOLDER}; git checkout HEAD -f \ || fatal "failed to copy etherpad to temporary folder" try mkdir "${TMP_FOLDER}"/.git try git rev-parse HEAD >${TMP_FOLDER}/.git/HEAD -try cp -r ./src/node_modules "${TMP_FOLDER}"/src/node_modules +try pnpm i "${TMP_FOLDER}"/src/node_modules try cd "${TMP_FOLDER}" [ -f src/package.json ] || fatal "failed to copy etherpad to temporary folder" diff --git a/src/bin/plugins/lib/README.md b/src/bin/plugins/lib/README.md index 2c50b538e..a3d0dc458 100755 --- a/src/bin/plugins/lib/README.md +++ b/src/bin/plugins/lib/README.md @@ -25,7 +25,7 @@ TODO To run the backend tests, run the following from the Etherpad working directory: ```shell -(cd src && npm test) +(cd src && pnpm test) ``` To run the frontend tests, visit: http://localhost:9001/tests/frontend/ diff --git a/src/bin/plugins/lib/backend-tests.yml b/src/bin/plugins/lib/backend-tests.yml index b80f57019..184eb26fc 100644 --- a/src/bin/plugins/lib/backend-tests.yml +++ b/src/bin/plugins/lib/backend-tests.yml @@ -72,4 +72,4 @@ jobs: run: src/bin/installDeps.sh - name: Run the backend tests - run: cd src && npm test + run: cd src && pnpm test