pad.pub0.org/.github/workflows/upgrade-from-latest-release...

111 lines
3.6 KiB
YAML
Raw Normal View History

name: "Upgrade from latest release"
# any branch is useful for testing before a PR is submitted
on: [push, pull_request]
permissions:
contents: read
jobs:
withpluginsLinux:
# run on pushes to any branch
# run on PRs from external forks
if: |
(github.event_name != 'pull_request')
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
name: Linux with Plugins
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [16, 18, 20]
steps:
-
name: Check out latest release
2022-03-01 22:17:16 +00:00
uses: actions/checkout@v3
with:
ref: master
-
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'npm'
cache-dependency-path: |
src/package-lock.json
src/bin/doc/package-lock.json
Use `npm link` to install ep_etherpad-lite. This places a package.json file in the root directory that references ./src directory as the file source for `ep_etherpad-lite`. Remove --legacy-peer-deps and --no-save when invoking npm. There is no need for them anymore, as we are bumping npm now to v8. ./src/package.json contains all dependencies of Etherpad core (package name ep_etherpad-lite) as before. The root directory's package.json file references ep_etherpad-lite and also contains references to any installed plugins. Remove npm from package.json as we depend on a recent version now; PATH is still updated as before, so in the future we may install a custom npm version again lint package-lock: update exception for sqlite3 remove node_modules and package.json during installDeps.sh update Dockerfile adapt minify windows build Fixed installOnWindows.bat remove node_modules from git bump minimal node/npm version in src/bin/functions.sh add changelog notes update installdeps fix dockerfile docker: test npm prefix set to the etherpad directory workflow: upgrade-from-latest-release needs to be adapted until next release is out Revert "docker: test npm prefix set to the etherpad directory" This reverts commit b856a2488c9dbfb2acf35309cd1ee83016b631ad. use npm link --bin-links=false to prevent it from copying bin files temp fix for scripts as they are not installed to bin directory anymore adjust bin paths in Dockerfile Dockerfile add hint for npm link, dockerfile update dockerfile Revert "Fixed installOnWindows.bat" This reverts commit 70d0716bbedc4c0c1043155fcc5d157f01775c61. try installOnWindows; still TODO: no difference between production and development; no warning like in installDeps.sh before update - it just removes package* and node_modules so admins must be aware of the plugins they want to reinstall later update installOnWindows.bat update package-lock.json Dockerfile Dockerfile add file: scheme for lint check - needed as long as we have the plugin compatibility symlinks in ./src/node_modules fix installOnWindows upgrade-from-latest-release workflow: adapt cypress installation src/package.json: test-container fix path to _mocha; maybe revert this in case we enable bin-links again src/package.json: add test-on-windows script another try with test-on-windows, without using bin-links use bin-links on windows Revert "use bin-links on windows" This reverts commit f50ec2a9fabe3098d48e8f412b73c01edbe2140e. invoke mocha binary on windows run npm i once on windows, to make bin files available - why? remove supertest on windows production builds add symlink for mocha debug Revert "debug" This reverts commit 8916a0515ca2897c57ca65fef49fd0b3610d2989. Revert "add symlink for mocha" This reverts commit 3c60bef77d2a120d24fce14421fe638598cd849d. windows workflow: adapt cypress path frontend admin tests
2023-07-05 18:48:58 +00:00
# FIXME after 1.9.2
# After 1.9.2 is released, we need to remove '--legacy-peer-deps --no-save'
-
name: Install Etherpad plugins
run: >
Use `npm link` to install ep_etherpad-lite. This places a package.json file in the root directory that references ./src directory as the file source for `ep_etherpad-lite`. Remove --legacy-peer-deps and --no-save when invoking npm. There is no need for them anymore, as we are bumping npm now to v8. ./src/package.json contains all dependencies of Etherpad core (package name ep_etherpad-lite) as before. The root directory's package.json file references ep_etherpad-lite and also contains references to any installed plugins. Remove npm from package.json as we depend on a recent version now; PATH is still updated as before, so in the future we may install a custom npm version again lint package-lock: update exception for sqlite3 remove node_modules and package.json during installDeps.sh update Dockerfile adapt minify windows build Fixed installOnWindows.bat remove node_modules from git bump minimal node/npm version in src/bin/functions.sh add changelog notes update installdeps fix dockerfile docker: test npm prefix set to the etherpad directory workflow: upgrade-from-latest-release needs to be adapted until next release is out Revert "docker: test npm prefix set to the etherpad directory" This reverts commit b856a2488c9dbfb2acf35309cd1ee83016b631ad. use npm link --bin-links=false to prevent it from copying bin files temp fix for scripts as they are not installed to bin directory anymore adjust bin paths in Dockerfile Dockerfile add hint for npm link, dockerfile update dockerfile Revert "Fixed installOnWindows.bat" This reverts commit 70d0716bbedc4c0c1043155fcc5d157f01775c61. try installOnWindows; still TODO: no difference between production and development; no warning like in installDeps.sh before update - it just removes package* and node_modules so admins must be aware of the plugins they want to reinstall later update installOnWindows.bat update package-lock.json Dockerfile Dockerfile add file: scheme for lint check - needed as long as we have the plugin compatibility symlinks in ./src/node_modules fix installOnWindows upgrade-from-latest-release workflow: adapt cypress installation src/package.json: test-container fix path to _mocha; maybe revert this in case we enable bin-links again src/package.json: add test-on-windows script another try with test-on-windows, without using bin-links use bin-links on windows Revert "use bin-links on windows" This reverts commit f50ec2a9fabe3098d48e8f412b73c01edbe2140e. invoke mocha binary on windows run npm i once on windows, to make bin files available - why? remove supertest on windows production builds add symlink for mocha debug Revert "debug" This reverts commit 8916a0515ca2897c57ca65fef49fd0b3610d2989. Revert "add symlink for mocha" This reverts commit 3c60bef77d2a120d24fce14421fe638598cd849d. windows workflow: adapt cypress path frontend admin tests
2023-07-05 18:48:58 +00:00
npm install --legacy-peer-deps --no-save
ep_align
ep_author_hover
ep_cursortrace
ep_font_size
ep_hash_auth
ep_headings2
ep_image_upload
ep_markdown
ep_readonly_guest
ep_set_title_on_pad
ep_spellcheck
ep_subscript_and_superscript
ep_table_of_contents
-
name: Install all dependencies and symlink for ep_etherpad-lite
run: src/bin/installDeps.sh
-
name: Run the backend tests
run: cd src && npm test
2022-03-01 22:17:16 +00:00
# Because actions/checkout@v3 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
# plain "git fetch" only fetches "normal" references (refs/heads/* and
# refs/tags/*), and for pull requests none of the normal references
# include ${GITHUB_SHA}, so we have to explicitly tell Git to fetch
# ${GITHUB_REF}.
-
name: Fetch the new Git commits
run: git fetch --depth=1 origin "${GITHUB_REF}"
-
name: Upgrade to the new Git revision
# For pull requests, ${GITHUB_SHA} is the automatically generated merge
# commit that merges the PR's source branch to its destination branch.
run: git checkout "${GITHUB_SHA}"
-
Use `npm link` to install ep_etherpad-lite. This places a package.json file in the root directory that references ./src directory as the file source for `ep_etherpad-lite`. Remove --legacy-peer-deps and --no-save when invoking npm. There is no need for them anymore, as we are bumping npm now to v8. ./src/package.json contains all dependencies of Etherpad core (package name ep_etherpad-lite) as before. The root directory's package.json file references ep_etherpad-lite and also contains references to any installed plugins. Remove npm from package.json as we depend on a recent version now; PATH is still updated as before, so in the future we may install a custom npm version again lint package-lock: update exception for sqlite3 remove node_modules and package.json during installDeps.sh update Dockerfile adapt minify windows build Fixed installOnWindows.bat remove node_modules from git bump minimal node/npm version in src/bin/functions.sh add changelog notes update installdeps fix dockerfile docker: test npm prefix set to the etherpad directory workflow: upgrade-from-latest-release needs to be adapted until next release is out Revert "docker: test npm prefix set to the etherpad directory" This reverts commit b856a2488c9dbfb2acf35309cd1ee83016b631ad. use npm link --bin-links=false to prevent it from copying bin files temp fix for scripts as they are not installed to bin directory anymore adjust bin paths in Dockerfile Dockerfile add hint for npm link, dockerfile update dockerfile Revert "Fixed installOnWindows.bat" This reverts commit 70d0716bbedc4c0c1043155fcc5d157f01775c61. try installOnWindows; still TODO: no difference between production and development; no warning like in installDeps.sh before update - it just removes package* and node_modules so admins must be aware of the plugins they want to reinstall later update installOnWindows.bat update package-lock.json Dockerfile Dockerfile add file: scheme for lint check - needed as long as we have the plugin compatibility symlinks in ./src/node_modules fix installOnWindows upgrade-from-latest-release workflow: adapt cypress installation src/package.json: test-container fix path to _mocha; maybe revert this in case we enable bin-links again src/package.json: add test-on-windows script another try with test-on-windows, without using bin-links use bin-links on windows Revert "use bin-links on windows" This reverts commit f50ec2a9fabe3098d48e8f412b73c01edbe2140e. invoke mocha binary on windows run npm i once on windows, to make bin files available - why? remove supertest on windows production builds add symlink for mocha debug Revert "debug" This reverts commit 8916a0515ca2897c57ca65fef49fd0b3610d2989. Revert "add symlink for mocha" This reverts commit 3c60bef77d2a120d24fce14421fe638598cd849d. windows workflow: adapt cypress path frontend admin tests
2023-07-05 18:48:58 +00:00
name: Temporary remove ./node_modules; Remove this after 1.9.2 release
run: rm -rf ./node_modules
-
name: Install the ep_etherpad-lite package from ./src
run: src/bin/installDeps.sh
Use `npm link` to install ep_etherpad-lite. This places a package.json file in the root directory that references ./src directory as the file source for `ep_etherpad-lite`. Remove --legacy-peer-deps and --no-save when invoking npm. There is no need for them anymore, as we are bumping npm now to v8. ./src/package.json contains all dependencies of Etherpad core (package name ep_etherpad-lite) as before. The root directory's package.json file references ep_etherpad-lite and also contains references to any installed plugins. Remove npm from package.json as we depend on a recent version now; PATH is still updated as before, so in the future we may install a custom npm version again lint package-lock: update exception for sqlite3 remove node_modules and package.json during installDeps.sh update Dockerfile adapt minify windows build Fixed installOnWindows.bat remove node_modules from git bump minimal node/npm version in src/bin/functions.sh add changelog notes update installdeps fix dockerfile docker: test npm prefix set to the etherpad directory workflow: upgrade-from-latest-release needs to be adapted until next release is out Revert "docker: test npm prefix set to the etherpad directory" This reverts commit b856a2488c9dbfb2acf35309cd1ee83016b631ad. use npm link --bin-links=false to prevent it from copying bin files temp fix for scripts as they are not installed to bin directory anymore adjust bin paths in Dockerfile Dockerfile add hint for npm link, dockerfile update dockerfile Revert "Fixed installOnWindows.bat" This reverts commit 70d0716bbedc4c0c1043155fcc5d157f01775c61. try installOnWindows; still TODO: no difference between production and development; no warning like in installDeps.sh before update - it just removes package* and node_modules so admins must be aware of the plugins they want to reinstall later update installOnWindows.bat update package-lock.json Dockerfile Dockerfile add file: scheme for lint check - needed as long as we have the plugin compatibility symlinks in ./src/node_modules fix installOnWindows upgrade-from-latest-release workflow: adapt cypress installation src/package.json: test-container fix path to _mocha; maybe revert this in case we enable bin-links again src/package.json: add test-on-windows script another try with test-on-windows, without using bin-links use bin-links on windows Revert "use bin-links on windows" This reverts commit f50ec2a9fabe3098d48e8f412b73c01edbe2140e. invoke mocha binary on windows run npm i once on windows, to make bin files available - why? remove supertest on windows production builds add symlink for mocha debug Revert "debug" This reverts commit 8916a0515ca2897c57ca65fef49fd0b3610d2989. Revert "add symlink for mocha" This reverts commit 3c60bef77d2a120d24fce14421fe638598cd849d. windows workflow: adapt cypress path frontend admin tests
2023-07-05 18:48:58 +00:00
-
name: Install Etherpad plugins again; Remove this after 1.9.2 release
run: >
npm install
ep_align
ep_author_hover
ep_cursortrace
ep_font_size
ep_hash_auth
ep_headings2
ep_image_upload
ep_markdown
ep_readonly_guest
ep_set_title_on_pad
ep_spellcheck
ep_subscript_and_superscript
ep_table_of_contents
-
name: Run the backend tests
run: cd src && npm test
-
name: Install Cypress
Use `npm link` to install ep_etherpad-lite. This places a package.json file in the root directory that references ./src directory as the file source for `ep_etherpad-lite`. Remove --legacy-peer-deps and --no-save when invoking npm. There is no need for them anymore, as we are bumping npm now to v8. ./src/package.json contains all dependencies of Etherpad core (package name ep_etherpad-lite) as before. The root directory's package.json file references ep_etherpad-lite and also contains references to any installed plugins. Remove npm from package.json as we depend on a recent version now; PATH is still updated as before, so in the future we may install a custom npm version again lint package-lock: update exception for sqlite3 remove node_modules and package.json during installDeps.sh update Dockerfile adapt minify windows build Fixed installOnWindows.bat remove node_modules from git bump minimal node/npm version in src/bin/functions.sh add changelog notes update installdeps fix dockerfile docker: test npm prefix set to the etherpad directory workflow: upgrade-from-latest-release needs to be adapted until next release is out Revert "docker: test npm prefix set to the etherpad directory" This reverts commit b856a2488c9dbfb2acf35309cd1ee83016b631ad. use npm link --bin-links=false to prevent it from copying bin files temp fix for scripts as they are not installed to bin directory anymore adjust bin paths in Dockerfile Dockerfile add hint for npm link, dockerfile update dockerfile Revert "Fixed installOnWindows.bat" This reverts commit 70d0716bbedc4c0c1043155fcc5d157f01775c61. try installOnWindows; still TODO: no difference between production and development; no warning like in installDeps.sh before update - it just removes package* and node_modules so admins must be aware of the plugins they want to reinstall later update installOnWindows.bat update package-lock.json Dockerfile Dockerfile add file: scheme for lint check - needed as long as we have the plugin compatibility symlinks in ./src/node_modules fix installOnWindows upgrade-from-latest-release workflow: adapt cypress installation src/package.json: test-container fix path to _mocha; maybe revert this in case we enable bin-links again src/package.json: add test-on-windows script another try with test-on-windows, without using bin-links use bin-links on windows Revert "use bin-links on windows" This reverts commit f50ec2a9fabe3098d48e8f412b73c01edbe2140e. invoke mocha binary on windows run npm i once on windows, to make bin files available - why? remove supertest on windows production builds add symlink for mocha debug Revert "debug" This reverts commit 8916a0515ca2897c57ca65fef49fd0b3610d2989. Revert "add symlink for mocha" This reverts commit 3c60bef77d2a120d24fce14421fe638598cd849d. windows workflow: adapt cypress path frontend admin tests
2023-07-05 18:48:58 +00:00
run: npm install cypress
-
name: Run Etherpad & Test Frontend
run: |
node src/node/server.js &
curl --connect-timeout 10 --max-time 20 --retry 5 --retry-delay 10 --retry-max-time 60 --retry-connrefused http://127.0.0.1:9001/p/test
Use `npm link` to install ep_etherpad-lite. This places a package.json file in the root directory that references ./src directory as the file source for `ep_etherpad-lite`. Remove --legacy-peer-deps and --no-save when invoking npm. There is no need for them anymore, as we are bumping npm now to v8. ./src/package.json contains all dependencies of Etherpad core (package name ep_etherpad-lite) as before. The root directory's package.json file references ep_etherpad-lite and also contains references to any installed plugins. Remove npm from package.json as we depend on a recent version now; PATH is still updated as before, so in the future we may install a custom npm version again lint package-lock: update exception for sqlite3 remove node_modules and package.json during installDeps.sh update Dockerfile adapt minify windows build Fixed installOnWindows.bat remove node_modules from git bump minimal node/npm version in src/bin/functions.sh add changelog notes update installdeps fix dockerfile docker: test npm prefix set to the etherpad directory workflow: upgrade-from-latest-release needs to be adapted until next release is out Revert "docker: test npm prefix set to the etherpad directory" This reverts commit b856a2488c9dbfb2acf35309cd1ee83016b631ad. use npm link --bin-links=false to prevent it from copying bin files temp fix for scripts as they are not installed to bin directory anymore adjust bin paths in Dockerfile Dockerfile add hint for npm link, dockerfile update dockerfile Revert "Fixed installOnWindows.bat" This reverts commit 70d0716bbedc4c0c1043155fcc5d157f01775c61. try installOnWindows; still TODO: no difference between production and development; no warning like in installDeps.sh before update - it just removes package* and node_modules so admins must be aware of the plugins they want to reinstall later update installOnWindows.bat update package-lock.json Dockerfile Dockerfile add file: scheme for lint check - needed as long as we have the plugin compatibility symlinks in ./src/node_modules fix installOnWindows upgrade-from-latest-release workflow: adapt cypress installation src/package.json: test-container fix path to _mocha; maybe revert this in case we enable bin-links again src/package.json: add test-on-windows script another try with test-on-windows, without using bin-links use bin-links on windows Revert "use bin-links on windows" This reverts commit f50ec2a9fabe3098d48e8f412b73c01edbe2140e. invoke mocha binary on windows run npm i once on windows, to make bin files available - why? remove supertest on windows production builds add symlink for mocha debug Revert "debug" This reverts commit 8916a0515ca2897c57ca65fef49fd0b3610d2989. Revert "add symlink for mocha" This reverts commit 3c60bef77d2a120d24fce14421fe638598cd849d. windows workflow: adapt cypress path frontend admin tests
2023-07-05 18:48:58 +00:00
./node_modules/cypress/bin/cypress run --config-file src/tests/frontend/cypress/cypress.config.js