2020-11-24 19:12:41 +01:00
|
|
|
name: "Backend tests"
|
|
|
|
|
|
|
|
# any branch is useful for testing before a PR is submitted
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
2022-04-26 03:08:54 +02:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2020-11-24 19:12:41 +01:00
|
|
|
jobs:
|
2021-02-18 19:49:43 +01:00
|
|
|
withoutpluginsLinux:
|
2020-11-24 19:12:41 +01:00
|
|
|
# run on pushes to any branch
|
|
|
|
# run on PRs from external forks
|
|
|
|
if: |
|
2022-01-28 07:33:52 +01:00
|
|
|
(github.event_name != 'pull_request')
|
|
|
|
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
|
2021-02-18 19:49:43 +01:00
|
|
|
name: Linux without plugins
|
2020-11-24 19:12:41 +01:00
|
|
|
runs-on: ubuntu-latest
|
2021-02-12 02:00:28 +01:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-11-29 14:23:14 +01:00
|
|
|
node: [18, 20, 21]
|
2020-11-24 19:12:41 +01:00
|
|
|
steps:
|
2022-01-28 07:33:52 +01:00
|
|
|
-
|
|
|
|
name: Checkout repository
|
2023-09-04 18:51:22 +02:00
|
|
|
uses: actions/checkout@v4
|
2022-01-28 07:33:52 +01:00
|
|
|
-
|
2023-10-25 19:08:24 +02:00
|
|
|
uses: actions/setup-node@v4
|
2022-01-28 07:33:52 +01:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node }}
|
2024-02-11 09:51:42 +01:00
|
|
|
- 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
|
2024-02-11 11:19:34 +01:00
|
|
|
- uses: actions/cache@v4
|
2024-02-11 09:51:42 +01:00
|
|
|
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
|
2022-01-28 07:33:52 +01:00
|
|
|
-
|
|
|
|
name: Install libreoffice
|
2024-03-06 13:41:33 +01:00
|
|
|
uses: awalsh128/cache-apt-pkgs-action@v1.4.2
|
2024-02-22 18:31:17 +01:00
|
|
|
with:
|
|
|
|
packages: libreoffice libreoffice-pdfimport
|
|
|
|
version: 1.0
|
2022-01-28 07:33:52 +01:00
|
|
|
-
|
|
|
|
name: Install all dependencies and symlink for ep_etherpad-lite
|
2024-02-21 21:50:11 +01:00
|
|
|
run: bin/installDeps.sh
|
2024-03-09 23:07:09 +01:00
|
|
|
- name: Install admin ui
|
|
|
|
working-directory: admin
|
|
|
|
run: pnpm install
|
|
|
|
- name: Build admin ui
|
|
|
|
working-directory: admin
|
|
|
|
run: pnpm build
|
2022-01-28 07:33:52 +01:00
|
|
|
-
|
|
|
|
name: Run the backend tests
|
2024-02-21 21:50:11 +01:00
|
|
|
run: pnpm test
|
2020-11-24 19:12:41 +01:00
|
|
|
|
2021-02-18 19:49:43 +01:00
|
|
|
withpluginsLinux:
|
2020-11-24 19:12:41 +01:00
|
|
|
# run on pushes to any branch
|
|
|
|
# run on PRs from external forks
|
|
|
|
if: |
|
2022-01-28 07:33:52 +01:00
|
|
|
(github.event_name != 'pull_request')
|
|
|
|
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
|
2021-02-18 19:49:43 +01:00
|
|
|
name: Linux with Plugins
|
2020-11-24 19:12:41 +01:00
|
|
|
runs-on: ubuntu-latest
|
2021-02-12 02:00:28 +01:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-11-29 14:23:14 +01:00
|
|
|
node: [18, 20, 21]
|
2020-11-24 19:12:41 +01:00
|
|
|
steps:
|
2022-01-28 07:33:52 +01:00
|
|
|
-
|
|
|
|
name: Checkout repository
|
2023-09-04 18:51:22 +02:00
|
|
|
uses: actions/checkout@v4
|
2022-01-28 07:33:52 +01:00
|
|
|
-
|
2023-10-25 19:08:24 +02:00
|
|
|
uses: actions/setup-node@v4
|
2022-01-28 07:33:52 +01:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node }}
|
2024-02-11 09:51:42 +01:00
|
|
|
- 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
|
2024-02-11 11:19:34 +01:00
|
|
|
- uses: actions/cache@v4
|
2024-02-11 09:51:42 +01:00
|
|
|
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
|
2022-01-28 07:33:52 +01:00
|
|
|
-
|
|
|
|
name: Install libreoffice
|
2024-03-06 13:41:33 +01:00
|
|
|
uses: awalsh128/cache-apt-pkgs-action@v1.4.2
|
2024-02-22 18:31:17 +01:00
|
|
|
with:
|
|
|
|
packages: libreoffice libreoffice-pdfimport
|
|
|
|
version: 1.0
|
2024-02-21 21:50:11 +01:00
|
|
|
-
|
|
|
|
name: Install all dependencies and symlink for ep_etherpad-lite
|
|
|
|
run: bin/installDeps.sh
|
2024-03-09 23:07:09 +01:00
|
|
|
- name: Install admin ui
|
|
|
|
working-directory: admin
|
|
|
|
run: pnpm install
|
|
|
|
- name: Build admin ui
|
|
|
|
working-directory: admin
|
|
|
|
run: pnpm build
|
2022-01-28 07:33:52 +01:00
|
|
|
-
|
|
|
|
name: Install Etherpad plugins
|
|
|
|
run: >
|
2024-02-19 22:31:27 +01:00
|
|
|
pnpm install --workspace-root
|
2022-01-28 07:33:52 +01:00
|
|
|
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
|
2024-02-21 21:50:11 +01:00
|
|
|
run: pnpm test
|
2021-02-18 19:49:43 +01:00
|
|
|
|
|
|
|
withoutpluginsWindows:
|
|
|
|
# run on pushes to any branch
|
|
|
|
# run on PRs from external forks
|
|
|
|
if: |
|
2022-01-28 07:33:52 +01:00
|
|
|
(github.event_name != 'pull_request')
|
|
|
|
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
|
2021-02-18 19:49:43 +01:00
|
|
|
name: Windows without plugins
|
|
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
2022-01-28 07:33:52 +01:00
|
|
|
-
|
|
|
|
name: Checkout repository
|
2023-09-04 18:51:22 +02:00
|
|
|
uses: actions/checkout@v4
|
2022-01-28 07:33:52 +01:00
|
|
|
-
|
2023-10-25 19:08:24 +02:00
|
|
|
uses: actions/setup-node@v4
|
2022-01-28 07:33:52 +01:00
|
|
|
with:
|
2023-06-26 19:11:32 +02:00
|
|
|
node-version: 20
|
2024-02-11 09:51:42 +01:00
|
|
|
- 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
|
2024-02-11 11:19:34 +01:00
|
|
|
- uses: actions/cache@v4
|
2024-02-11 09:51:42 +01:00
|
|
|
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
|
2022-01-28 07:33:52 +01:00
|
|
|
-
|
|
|
|
name: Install all dependencies and symlink for ep_etherpad-lite
|
2024-02-21 21:50:11 +01:00
|
|
|
run: bin/installOnWindows.bat
|
2024-03-09 23:07:09 +01:00
|
|
|
- name: Install admin ui
|
|
|
|
working-directory: admin
|
|
|
|
run: pnpm install
|
|
|
|
- name: Build admin ui
|
|
|
|
working-directory: admin
|
|
|
|
run: pnpm build
|
2022-01-28 07:33:52 +01:00
|
|
|
-
|
|
|
|
name: Fix up the settings.json
|
|
|
|
run: |
|
|
|
|
powershell -Command "(gc settings.json.template) -replace '\"max\": 10', '\"max\": 10000' | Out-File -encoding ASCII settings.json.holder"
|
|
|
|
powershell -Command "(gc settings.json.holder) -replace '\"points\": 10', '\"points\": 1000' | Out-File -encoding ASCII settings.json"
|
|
|
|
-
|
|
|
|
name: Run the backend tests
|
2024-02-11 09:51:42 +01:00
|
|
|
run: cd src && pnpm test
|
2021-02-18 19:49:43 +01:00
|
|
|
|
|
|
|
withpluginsWindows:
|
|
|
|
# run on pushes to any branch
|
|
|
|
# run on PRs from external forks
|
|
|
|
if: |
|
2022-01-28 07:33:52 +01:00
|
|
|
(github.event_name != 'pull_request')
|
|
|
|
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
|
2021-02-18 19:49:43 +01:00
|
|
|
name: Windows with Plugins
|
|
|
|
runs-on: windows-latest
|
|
|
|
|
|
|
|
steps:
|
2022-01-28 07:33:52 +01:00
|
|
|
-
|
|
|
|
name: Checkout repository
|
2023-09-04 18:51:22 +02:00
|
|
|
uses: actions/checkout@v4
|
2022-01-28 07:33:52 +01:00
|
|
|
-
|
2023-10-25 19:08:24 +02:00
|
|
|
uses: actions/setup-node@v4
|
2022-01-28 07:33:52 +01:00
|
|
|
with:
|
2024-02-11 09:51:42 +01:00
|
|
|
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
|
2024-02-11 11:19:34 +01:00
|
|
|
- uses: actions/cache@v4
|
2024-02-11 09:51:42 +01:00
|
|
|
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
|
2024-03-09 23:07:09 +01:00
|
|
|
- name: Install admin ui
|
|
|
|
working-directory: admin
|
|
|
|
run: pnpm install
|
|
|
|
- name: Build admin ui
|
|
|
|
working-directory: admin
|
|
|
|
run: pnpm build
|
2022-01-28 07:33:52 +01:00
|
|
|
-
|
|
|
|
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: >
|
2024-02-19 22:31:27 +01:00
|
|
|
pnpm install --workspace-root
|
2022-01-28 07:33:52 +01:00
|
|
|
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
|
2024-02-21 21:50:11 +01:00
|
|
|
run: bin/installOnWindows.bat
|
2022-01-28 07:33:52 +01:00
|
|
|
-
|
|
|
|
name: Fix up the settings.json
|
|
|
|
run: |
|
|
|
|
powershell -Command "(gc settings.json.template) -replace '\"max\": 10', '\"max\": 10000' | Out-File -encoding ASCII settings.json.holder"
|
|
|
|
powershell -Command "(gc settings.json.holder) -replace '\"points\": 10', '\"points\": 1000' | Out-File -encoding ASCII settings.json"
|
|
|
|
-
|
|
|
|
name: Run the backend tests
|
2024-02-11 09:51:42 +01:00
|
|
|
run: cd src && pnpm test
|