2021-04-20 16:19:32 +00:00
|
|
|
name: "Upgrade from latest release"
|
2021-03-05 06:38:50 +00:00
|
|
|
|
|
|
|
# any branch is useful for testing before a PR is submitted
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
2022-04-26 01:08:54 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2021-03-05 06:38:50 +00:00
|
|
|
jobs:
|
|
|
|
withpluginsLinux:
|
|
|
|
# run on pushes to any branch
|
|
|
|
# run on PRs from external forks
|
|
|
|
if: |
|
2022-01-28 06:33:52 +00:00
|
|
|
(github.event_name != 'pull_request')
|
|
|
|
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
|
2021-03-05 06:38:50 +00:00
|
|
|
name: Linux with Plugins
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-06-26 17:11:32 +00:00
|
|
|
node: [16, 18, 20]
|
2021-03-05 06:38:50 +00:00
|
|
|
steps:
|
2022-01-28 06:33:52 +00:00
|
|
|
-
|
|
|
|
name: Check out latest release
|
2022-03-01 22:17:16 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-01-28 06:33:52 +00:00
|
|
|
with:
|
|
|
|
ref: master
|
|
|
|
-
|
2022-02-25 15:32:24 +00:00
|
|
|
uses: actions/setup-node@v3
|
2022-01-28 06:33:52 +00:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node }}
|
|
|
|
cache: 'npm'
|
|
|
|
cache-dependency-path: |
|
|
|
|
src/package-lock.json
|
|
|
|
src/bin/doc/package-lock.json
|
|
|
|
-
|
|
|
|
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
|
|
|
|
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
|
|
|
|
# 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
|
|
|
|
# in the top-level node_modules. As of v6.14.10, npm's hoist logic appears
|
|
|
|
# to be buggy, because it sometimes removes dependencies from
|
|
|
|
# src/node_modules but fails to add them to the top-level node_modules.
|
|
|
|
# Even if npm correctly hoists the dependencies, the hoisting seems to
|
|
|
|
# confuse tools such as `npm outdated`, `npm update`, and some ESLint
|
|
|
|
# rules.
|
|
|
|
-
|
|
|
|
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
|
2022-01-28 06:33:52 +00:00
|
|
|
# "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}"
|
|
|
|
-
|
|
|
|
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
|
|
|
|
-
|
|
|
|
name: Install Cypress
|
2022-09-24 14:16:31 +00:00
|
|
|
run: cd src && npm install cypress
|
2022-01-28 06:33:52 +00:00
|
|
|
-
|
|
|
|
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
|
2022-09-24 14:16:31 +00:00
|
|
|
./src/node_modules/cypress/bin/cypress run --config-file src/tests/frontend/cypress/cypress.config.js
|