Skip to content

Commit 0000fb6

Browse files
committed
Add 'ep_right_to_left/' from commit '1521c4cb8226a3f3a3920f375c56a4997184e8f1'
git-subtree-dir: ep_right_to_left git-subtree-mainline: 36f3ac1 git-subtree-split: 1521c4c
2 parents 36f3ac1 + 1521c4c commit 0000fb6

File tree

15 files changed

+2521
-0
lines changed

15 files changed

+2521
-0
lines changed

ep_right_to_left/.eslintrc.cjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict';
2+
3+
// This is a workaround for https://github.com/eslint/eslint/issues/3458
4+
require('eslint-config-etherpad/patch/modern-module-resolution');
5+
6+
module.exports = {
7+
root: true,
8+
extends: 'etherpad/plugin',
9+
};
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
- package-ecosystem: "npm"
8+
directory: "/"
9+
schedule:
10+
interval: "daily"
11+
versioning-strategy: "increase"
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Backend Tests
2+
3+
# any branch is useful for testing before a PR is submitted
4+
on:
5+
workflow_call:
6+
7+
jobs:
8+
withplugins:
9+
# run on pushes to any branch
10+
# run on PRs from external forks
11+
if: |
12+
(github.event_name != 'pull_request')
13+
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
14+
name: with Plugins
15+
runs-on: ubuntu-latest
16+
steps:
17+
-
18+
name: Install libreoffice
19+
uses: awalsh128/[email protected]
20+
with:
21+
packages: libreoffice libreoffice-pdfimport
22+
version: 1.0
23+
-
24+
name: Install etherpad core
25+
uses: actions/checkout@v3
26+
with:
27+
repository: ether/etherpad-lite
28+
path: etherpad-lite
29+
- uses: pnpm/action-setup@v3
30+
name: Install pnpm
31+
with:
32+
version: 8
33+
run_install: false
34+
- name: Get pnpm store directory
35+
shell: bash
36+
run: |
37+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
38+
- uses: actions/cache@v4
39+
name: Setup pnpm cache
40+
with:
41+
path: ${{ env.STORE_PATH }}
42+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
43+
restore-keys: |
44+
${{ runner.os }}-pnpm-store-
45+
-
46+
name: Checkout plugin repository
47+
uses: actions/checkout@v3
48+
with:
49+
path: plugin
50+
-
51+
name: Determine plugin name
52+
id: plugin_name
53+
working-directory: ./plugin
54+
run: |
55+
npx -c 'printf %s\\n "::set-output name=plugin_name::${npm_package_name}"'
56+
-
57+
name: Link plugin directory
58+
working-directory: ./plugin
59+
run: |
60+
pnpm link --global
61+
- name: Remove tests
62+
working-directory: ./etherpad-lite
63+
run: rm -rf ./src/tests/backend/specs
64+
-
65+
name: Install Etherpad core dependencies
66+
working-directory: ./etherpad-lite
67+
run: bin/installDeps.sh
68+
- name: Link plugin to etherpad-lite
69+
working-directory: ./etherpad-lite
70+
run: |
71+
pnpm link --global $PLUGIN_NAME
72+
pnpm run install-plugins --path ../../plugin
73+
env:
74+
PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }}
75+
- name: Link ep_etherpad-lite
76+
working-directory: ./etherpad-lite/src
77+
run: |
78+
pnpm link --global
79+
- name: Link etherpad to plugin
80+
working-directory: ./plugin
81+
run: |
82+
pnpm link --global ep_etherpad-lite
83+
-
84+
name: Run the backend tests
85+
working-directory: ./etherpad-lite
86+
run: |
87+
res=$(find .. -path "./node_modules/ep_*/static/tests/backend/specs/**" | wc -l)
88+
if [ $res -eq 0 ]; then
89+
echo "No backend tests found"
90+
else
91+
pnpm run test
92+
fi
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Publicly credit Sauce Labs because they generously support open source
2+
# projects.
3+
name: Frontend Tests
4+
5+
on:
6+
workflow_call:
7+
8+
jobs:
9+
test-frontend:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
-
14+
name: Check out Etherpad core
15+
uses: actions/checkout@v3
16+
with:
17+
repository: ether/etherpad-lite
18+
- uses: pnpm/action-setup@v3
19+
name: Install pnpm
20+
with:
21+
version: 8
22+
run_install: false
23+
- name: Get pnpm store directory
24+
shell: bash
25+
run: |
26+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
27+
- uses: actions/cache@v4
28+
name: Setup pnpm cache
29+
with:
30+
path: ${{ env.STORE_PATH }}
31+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
32+
restore-keys: |
33+
${{ runner.os }}-pnpm-store-
34+
-
35+
name: Check out the plugin
36+
uses: actions/checkout@v3
37+
with:
38+
path: ./node_modules/__tmp
39+
-
40+
name: export GIT_HASH to env
41+
id: environment
42+
run: |
43+
cd ./node_modules/__tmp
44+
echo "::set-output name=sha_short::$(git rev-parse --short ${{ github.sha }})"
45+
-
46+
name: Determine plugin name
47+
id: plugin_name
48+
run: |
49+
cd ./node_modules/__tmp
50+
npx -c 'printf %s\\n "::set-output name=plugin_name::${npm_package_name}"'
51+
-
52+
name: Rename plugin directory
53+
env:
54+
PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }}
55+
run: |
56+
mv ./node_modules/__tmp ./node_modules/"${PLUGIN_NAME}"
57+
-
58+
name: Install plugin dependencies
59+
env:
60+
PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }}
61+
run: |
62+
cd ./node_modules/"${PLUGIN_NAME}"
63+
pnpm i
64+
# Etherpad core dependencies must be installed after installing the
65+
# plugin's dependencies, otherwise npm will try to hoist common
66+
# dependencies by removing them from src/node_modules and installing them
67+
# in the top-level node_modules. As of v6.14.10, npm's hoist logic appears
68+
# to be buggy, because it sometimes removes dependencies from
69+
# src/node_modules but fails to add them to the top-level node_modules.
70+
# Even if npm correctly hoists the dependencies, the hoisting seems to
71+
# confuse tools such as `npm outdated`, `npm update`, and some ESLint
72+
# rules.
73+
-
74+
name: Install Etherpad core dependencies
75+
run: bin/installDeps.sh
76+
- name: Create settings.json
77+
run: cp ./src/tests/settings.json settings.json
78+
- name: Run the frontend tests
79+
shell: bash
80+
run: |
81+
pnpm run dev &
82+
connected=false
83+
can_connect() {
84+
curl -sSfo /dev/null http://localhost:9001/ || return 1
85+
connected=true
86+
}
87+
now() { date +%s; }
88+
start=$(now)
89+
while [ $(($(now) - $start)) -le 15 ] && ! can_connect; do
90+
sleep 1
91+
done
92+
cd src
93+
pnpm exec playwright install chromium --with-deps
94+
pnpm run test-ui --project=chromium
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# This workflow will run tests using node and then publish a package to the npm registry when a release is created
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3+
4+
name: Node.js Package
5+
6+
on:
7+
workflow_call:
8+
9+
jobs:
10+
publish-npm:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: 20
16+
registry-url: https://registry.npmjs.org/
17+
- name: Check out Etherpad core
18+
uses: actions/checkout@v3
19+
with:
20+
repository: ether/etherpad-lite
21+
- uses: pnpm/action-setup@v3
22+
name: Install pnpm
23+
with:
24+
version: 8
25+
run_install: false
26+
- name: Get pnpm store directory
27+
shell: bash
28+
run: |
29+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
30+
- uses: actions/cache@v4
31+
name: Setup pnpm cache
32+
with:
33+
path: ${{ env.STORE_PATH }}
34+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
35+
restore-keys: |
36+
${{ runner.os }}-pnpm-store-
37+
-
38+
uses: actions/checkout@v3
39+
with:
40+
fetch-depth: 0
41+
-
42+
name: Bump version (patch)
43+
run: |
44+
LATEST_TAG=$(git describe --tags --abbrev=0) || exit 1
45+
NEW_COMMITS=$(git rev-list --count "${LATEST_TAG}"..) || exit 1
46+
[ "${NEW_COMMITS}" -gt 0 ] || exit 0
47+
git config user.name 'github-actions[bot]'
48+
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
49+
pnpm i
50+
pnpm version patch
51+
git push --follow-tags
52+
# This is required if the package has a prepare script that uses something
53+
# in dependencies or devDependencies.
54+
-
55+
run: pnpm i
56+
# `npm publish` must come after `git push` otherwise there is a race
57+
# condition: If two PRs are merged back-to-back then master/main will be
58+
# updated with the commits from the second PR before the first PR's
59+
# workflow has a chance to push the commit generated by `npm version
60+
# patch`. This causes the first PR's `git push` step to fail after the
61+
# package has already been published, which in turn will cause all future
62+
# workflow runs to fail because they will all attempt to use the same
63+
# already-used version number. By running `npm publish` after `git push`,
64+
# back-to-back merges will cause the first merge's workflow to fail but
65+
# the second's will succeed.
66+
-
67+
run: pnpm publish
68+
env:
69+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
70+
#-
71+
# name: Add package to etherpad organization
72+
# run: pnpm access grant read-write etherpad:developers
73+
# env:
74+
# NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Node.js Package
2+
on: [push]
3+
4+
5+
jobs:
6+
backend:
7+
uses: ./.github/workflows/backend-tests.yml
8+
secrets: inherit
9+
frontend:
10+
uses: ./.github/workflows/frontend-tests.yml
11+
secrets: inherit
12+
release:
13+
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }}
14+
needs:
15+
- backend
16+
- frontend
17+
uses: ./.github/workflows/npmpublish.yml
18+
secrets: inherit

ep_right_to_left/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.ep_initialized
2+
.DS_Store
3+
node_modules/
4+
node_modules
5+
npm-debug.log

ep_right_to_left/.travis.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
language: node_js
2+
3+
node_js:
4+
- "lts/*"
5+
6+
cache: false
7+
8+
services:
9+
- docker
10+
11+
install:
12+
- "export GIT_HASH=$(git rev-parse --verify --short HEAD)"
13+
14+
#script:
15+
# - "tests/frontend/travis/runner.sh"
16+
17+
env:
18+
global:
19+
- secure: "WMGxFkOeTTlhWB+ChMucRtIqVmMbwzYdNHuHQjKCcj8HBEPdZLfCuK/kf4rG\nVLcLQiIsyllqzNhBGVHG1nyqWr0/LTm8JRqSCDDVIhpyzp9KpCJQQJG2Uwjk\n6/HIJJh/wbxsEdLNV2crYU/EiVO3A4Bq0YTHUlbhUqG3mSCr5Ec="
20+
- secure: "gejXUAHYscbR6Bodw35XexpToqWkv2ifeECsbeEmjaLkYzXmUUNWJGknKSu7\nEUsSfQV8w+hxApr1Z+jNqk9aX3K1I4btL3cwk2trnNI8XRAvu1c1Iv60eerI\nkE82Rsd5lwUaMEh+/HoL8ztFCZamVndoNgX7HWp5J/NRZZMmh4g="
21+
22+
jobs:
23+
include:
24+
- name: "Lint test package-lock"
25+
install:
26+
- "npm install lockfile-lint"
27+
script:
28+
- npx lockfile-lint --path package-lock.json --validate-https --allowed-hosts npm
29+
- name: "Run the Backend tests"
30+
before_install:
31+
- sudo add-apt-repository -y ppa:libreoffice/ppa
32+
- sudo apt-get update
33+
- sudo apt-get -y install libreoffice
34+
- sudo apt-get -y install libreoffice-pdfimport
35+
install:
36+
- "npm install"
37+
- "mkdir ep_right_to_left"
38+
- "mv !(ep_right_to_left) ep_right_to_left"
39+
- "git clone https://github.com/ether/etherpad-lite.git etherpad"
40+
- "cd etherpad"
41+
- "mkdir -p node_modules"
42+
- "mv ../ep_right_to_left node_modules"
43+
- "bin/installDeps.sh"
44+
- "export GIT_HASH=$(git rev-parse --verify --short HEAD)"
45+
- "cd src && npm install && cd -"
46+
script:
47+
- "tests/frontend/travis/runnerBackend.sh"
48+
- name: "Test the Frontend"
49+
before_script:
50+
- "tests/frontend/travis/sauce_tunnel.sh"
51+
install:
52+
- "npm install"
53+
- "mkdir ep_right_to_left"
54+
- "mv !(ep_right_to_left) ep_right_to_left"
55+
- "git clone https://github.com/ether/etherpad-lite.git etherpad"
56+
- "cd etherpad"
57+
- "mkdir -p node_modules"
58+
- "mv ../ep_right_to_left node_modules"
59+
- "bin/installDeps.sh"
60+
- "export GIT_HASH=$(git rev-parse --verify --short HEAD)"
61+
script:
62+
- "tests/frontend/travis/runner.sh"
63+
64+
notifications:
65+
irc:
66+
channels:
67+
- "irc.freenode.org#etherpad-lite-dev"
68+
69+
##ETHERPAD_TRAVIS_V=9
70+
## Travis configuration automatically created using bin/plugins/updateAllPluginsScript.sh

0 commit comments

Comments
 (0)