2020-11-30 18:22:52 +01:00
|
|
|
name: "Backend tests"
|
|
|
|
|
|
|
|
# any branch is useful for testing before a PR is submitted
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
withplugins:
|
|
|
|
# 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)
|
2020-11-30 18:22:52 +01:00
|
|
|
name: with Plugins
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2022-01-28 07:33:52 +01:00
|
|
|
-
|
|
|
|
name: Install libreoffice
|
2024-03-13 19:11:19 +01:00
|
|
|
uses: awalsh128/cache-apt-pkgs-action@v1.4.2
|
|
|
|
with:
|
|
|
|
packages: libreoffice libreoffice-pdfimport
|
|
|
|
version: 1.0
|
2022-01-28 07:33:52 +01:00
|
|
|
-
|
|
|
|
name: Install etherpad core
|
2022-03-01 23:17:16 +01:00
|
|
|
uses: actions/checkout@v3
|
2022-01-28 07:33:52 +01:00
|
|
|
with:
|
|
|
|
repository: ether/etherpad-lite
|
|
|
|
-
|
|
|
|
name: Checkout plugin repository
|
2022-03-01 23:17:16 +01:00
|
|
|
uses: actions/checkout@v3
|
2022-01-28 07:33:52 +01:00
|
|
|
with:
|
|
|
|
path: ./node_modules/__tmp
|
|
|
|
-
|
|
|
|
name: Determine plugin name
|
|
|
|
id: plugin_name
|
|
|
|
run: |
|
|
|
|
cd ./node_modules/__tmp
|
|
|
|
npx -c 'printf %s\\n "::set-output name=plugin_name::${npm_package_name}"'
|
|
|
|
-
|
|
|
|
name: Rename plugin directory
|
|
|
|
run: |
|
|
|
|
mv ./node_modules/__tmp ./node_modules/"${PLUGIN_NAME}"
|
|
|
|
env:
|
|
|
|
PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }}
|
2024-03-13 19:11:19 +01:00
|
|
|
- uses: pnpm/action-setup@v3
|
|
|
|
name: Install pnpm
|
2022-01-28 07:33:52 +01:00
|
|
|
with:
|
2024-03-13 19:11:19 +01:00
|
|
|
version: 8
|
|
|
|
run_install: false
|
|
|
|
- name: Get pnpm store directory
|
|
|
|
shell: bash
|
2022-01-28 07:33:52 +01:00
|
|
|
run: |
|
2024-03-13 19:11:19 +01:00
|
|
|
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
|
|
|
- uses: actions/cache@v4
|
|
|
|
name: Setup pnpm cache
|
|
|
|
with:
|
|
|
|
path: ${{ env.STORE_PATH }}
|
|
|
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pnpm-store-
|
2022-01-28 07:33:52 +01:00
|
|
|
# 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 Etherpad core dependencies
|
2024-02-21 21:50:11 +01:00
|
|
|
run: bin/installDeps.sh
|
2022-01-28 07:33:52 +01:00
|
|
|
-
|
|
|
|
name: Run the backend tests
|
2024-03-13 19:11:19 +01:00
|
|
|
run: pnpm run test
|