ci: Reformat .yml files for readability

This commit is contained in:
Richard Hansen 2022-01-28 01:33:52 -05:00
parent 84c7da82cf
commit 43aa1e4aeb
13 changed files with 904 additions and 893 deletions

View file

@ -8,190 +8,193 @@ jobs:
# run on pushes to any branch # run on pushes to any branch
# run on PRs from external forks # run on PRs from external forks
if: | if: |
(github.event_name != 'pull_request') (github.event_name != 'pull_request')
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id) || (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
name: Linux without plugins name: Linux without plugins
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
node: [12, 14, 16] node: [12, 14, 16]
steps: steps:
- name: Checkout repository -
uses: actions/checkout@v2 name: Checkout repository
uses: actions/checkout@v2
- uses: actions/setup-node@v2 -
with: uses: actions/setup-node@v2
node-version: ${{ matrix.node }} with:
cache: 'npm' node-version: ${{ matrix.node }}
cache-dependency-path: | cache: 'npm'
src/package-lock.json cache-dependency-path: |
src/bin/doc/package-lock.json src/package-lock.json
src/bin/doc/package-lock.json
- name: Install libreoffice -
run: | name: Install libreoffice
sudo add-apt-repository -y ppa:libreoffice/ppa run: |
sudo apt update sudo add-apt-repository -y ppa:libreoffice/ppa
sudo apt install -y --no-install-recommends libreoffice libreoffice-pdfimport sudo apt update
sudo apt install -y --no-install-recommends libreoffice libreoffice-pdfimport
- name: Install all dependencies and symlink for ep_etherpad-lite -
run: src/bin/installDeps.sh 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: Run the backend tests
run: cd src && npm test
withpluginsLinux: withpluginsLinux:
# run on pushes to any branch # run on pushes to any branch
# run on PRs from external forks # run on PRs from external forks
if: | if: |
(github.event_name != 'pull_request') (github.event_name != 'pull_request')
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id) || (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
name: Linux with Plugins name: Linux with Plugins
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
node: [12, 14, 16] node: [12, 14, 16]
steps: steps:
- name: Checkout repository -
uses: actions/checkout@v2 name: Checkout repository
uses: actions/checkout@v2
- uses: actions/setup-node@v2 -
with: uses: actions/setup-node@v2
node-version: ${{ matrix.node }} with:
cache: 'npm' node-version: ${{ matrix.node }}
cache-dependency-path: | cache: 'npm'
src/package-lock.json cache-dependency-path: |
src/bin/doc/package-lock.json src/package-lock.json
src/bin/doc/package-lock.json
- name: Install libreoffice -
run: | name: Install libreoffice
sudo add-apt-repository -y ppa:libreoffice/ppa run: |
sudo apt update sudo add-apt-repository -y ppa:libreoffice/ppa
sudo apt install -y --no-install-recommends libreoffice libreoffice-pdfimport sudo apt update
sudo apt install -y --no-install-recommends libreoffice libreoffice-pdfimport
- name: Install Etherpad plugins -
# The --legacy-peer-deps flag is required to work around a bug in npm v7: name: Install Etherpad plugins
# https://github.com/npm/cli/issues/2199 # The --legacy-peer-deps flag is required to work around a bug in npm v7:
run: > # https://github.com/npm/cli/issues/2199
npm install --no-save --legacy-peer-deps run: >
ep_align npm install --no-save --legacy-peer-deps
ep_author_hover ep_align
ep_cursortrace ep_author_hover
ep_font_size ep_cursortrace
ep_hash_auth ep_font_size
ep_headings2 ep_hash_auth
ep_image_upload ep_headings2
ep_markdown ep_image_upload
ep_readonly_guest ep_markdown
ep_set_title_on_pad ep_readonly_guest
ep_spellcheck ep_set_title_on_pad
ep_subscript_and_superscript ep_spellcheck
ep_table_of_contents ep_subscript_and_superscript
ep_table_of_contents
# This must be run after installing the plugins, otherwise npm will try to # Etherpad core dependencies must be installed after installing the
# hoist common dependencies by removing them from src/node_modules and # plugin's dependencies, otherwise npm will try to hoist common
# installing them in the top-level node_modules. As of v6.14.10, npm's hoist # dependencies by removing them from src/node_modules and installing them
# logic appears to be buggy, because it sometimes removes dependencies from # in the top-level node_modules. As of v6.14.10, npm's hoist logic appears
# src/node_modules but fails to add them to the top-level node_modules. Even # to be buggy, because it sometimes removes dependencies from
# if npm correctly hoists the dependencies, the hoisting seems to confuse # src/node_modules but fails to add them to the top-level node_modules.
# tools such as `npm outdated`, `npm update`, and some ESLint rules. # Even if npm correctly hoists the dependencies, the hoisting seems to
- name: Install all dependencies and symlink for ep_etherpad-lite # confuse tools such as `npm outdated`, `npm update`, and some ESLint
run: src/bin/installDeps.sh # rules.
-
- name: Run the backend tests name: Install all dependencies and symlink for ep_etherpad-lite
run: cd src && npm test run: src/bin/installDeps.sh
-
name: Run the backend tests
run: cd src && npm test
withoutpluginsWindows: withoutpluginsWindows:
# run on pushes to any branch # run on pushes to any branch
# run on PRs from external forks # run on PRs from external forks
if: | if: |
(github.event_name != 'pull_request') (github.event_name != 'pull_request')
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id) || (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
name: Windows without plugins name: Windows without plugins
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- name: Checkout repository -
uses: actions/checkout@v2 name: Checkout repository
uses: actions/checkout@v2
- uses: actions/setup-node@v2 -
with: uses: actions/setup-node@v2
node-version: 12 with:
cache: 'npm' node-version: 12
cache-dependency-path: | cache: 'npm'
src/package-lock.json cache-dependency-path: |
src/bin/doc/package-lock.json src/package-lock.json
src/bin/doc/package-lock.json
- name: Install all dependencies and symlink for ep_etherpad-lite -
run: src/bin/installOnWindows.bat name: Install all dependencies and symlink for ep_etherpad-lite
run: src/bin/installOnWindows.bat
- name: Fix up the settings.json -
run: | name: Fix up the settings.json
powershell -Command "(gc settings.json.template) -replace '\"max\": 10', '\"max\": 10000' | Out-File -encoding ASCII settings.json.holder" run: |
powershell -Command "(gc settings.json.holder) -replace '\"points\": 10', '\"points\": 1000' | Out-File -encoding ASCII settings.json" 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 -
run: cd src && npm test name: Run the backend tests
run: cd src && npm test
withpluginsWindows: withpluginsWindows:
# run on pushes to any branch # run on pushes to any branch
# run on PRs from external forks # run on PRs from external forks
if: | if: |
(github.event_name != 'pull_request') (github.event_name != 'pull_request')
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id) || (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
name: Windows with Plugins name: Windows with Plugins
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- name: Checkout repository -
uses: actions/checkout@v2 name: Checkout repository
uses: actions/checkout@v2
- uses: actions/setup-node@v2 -
with: uses: actions/setup-node@v2
node-version: 12 with:
cache: 'npm' node-version: 12
cache-dependency-path: | cache: 'npm'
src/package-lock.json cache-dependency-path: |
src/bin/doc/package-lock.json 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: name: Install Etherpad plugins
# https://github.com/npm/cli/issues/2199 # The --legacy-peer-deps flag is required to work around a bug in npm
run: > # v7: https://github.com/npm/cli/issues/2199
npm install --no-save --legacy-peer-deps run: >
ep_align npm install --no-save --legacy-peer-deps
ep_author_hover ep_align
ep_cursortrace ep_author_hover
ep_font_size ep_cursortrace
ep_hash_auth ep_font_size
ep_headings2 ep_hash_auth
ep_image_upload ep_headings2
ep_markdown ep_image_upload
ep_readonly_guest ep_markdown
ep_set_title_on_pad ep_readonly_guest
ep_spellcheck ep_set_title_on_pad
ep_subscript_and_superscript ep_spellcheck
ep_table_of_contents ep_subscript_and_superscript
ep_table_of_contents
# This must be run after installing the plugins, otherwise npm will try to # Etherpad core dependencies must be installed after installing the
# hoist common dependencies by removing them from src/node_modules and # plugin's dependencies, otherwise npm will try to hoist common
# installing them in the top-level node_modules. As of v6.14.10, npm's hoist # dependencies by removing them from src/node_modules and installing them
# logic appears to be buggy, because it sometimes removes dependencies from # in the top-level node_modules. As of v6.14.10, npm's hoist logic appears
# src/node_modules but fails to add them to the top-level node_modules. Even # to be buggy, because it sometimes removes dependencies from
# if npm correctly hoists the dependencies, the hoisting seems to confuse # src/node_modules but fails to add them to the top-level node_modules.
# tools such as `npm outdated`, `npm update`, and some ESLint rules. # Even if npm correctly hoists the dependencies, the hoisting seems to
- name: Install all dependencies and symlink for ep_etherpad-lite # confuse tools such as `npm outdated`, `npm update`, and some ESLint
run: src/bin/installOnWindows.bat # rules.
-
- name: Fix up the settings.json name: Install all dependencies and symlink for ep_etherpad-lite
run: | run: src/bin/installOnWindows.bat
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: Fix up the settings.json
run: |
- name: Run the backend tests powershell -Command "(gc settings.json.template) -replace '\"max\": 10', '\"max\": 10000' | Out-File -encoding ASCII settings.json.holder"
run: cd src && npm test powershell -Command "(gc settings.json.holder) -replace '\"points\": 10', '\"points\": 1000' | Out-File -encoding ASCII settings.json"
-
name: Run the backend tests
run: cd src && npm test

View file

@ -13,42 +13,25 @@ jobs:
analyze: analyze:
name: Analyze name: Analyze
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository -
uses: actions/checkout@v2 name: Checkout repository
with: uses: actions/checkout@v2
# We must fetch at least the immediate parents so that if this is with:
# a pull request then we can checkout the head. # We must fetch at least the immediate parents so that if this is
fetch-depth: 2 # a pull request then we can checkout the head.
fetch-depth: 2
# If this run was triggered by a pull request event, then checkout # If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit. # the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2 -
if: ${{ github.event_name == 'pull_request' }} run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# Initializes the CodeQL tools for scanning. -
- name: Initialize CodeQL name: Initialize CodeQL
uses: github/codeql-action/init@v1 uses: github/codeql-action/init@v1
# Override language selection by uncommenting this and choosing your languages -
# with: name: Autobuild
# languages: go, javascript, csharp, python, cpp, java uses: github/codeql-action/autobuild@v1
-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). name: Perform CodeQL Analysis
# If this step fails, then you should remove it and run the build manually (see below) uses: github/codeql-action/analyze@v1
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

View file

@ -14,72 +14,74 @@ jobs:
node: [12, 14, 16] node: [12, 14, 16]
steps: steps:
- name: Generate Sauce Labs strings -
id: sauce_strings name: Generate Sauce Labs strings
run: | id: sauce_strings
printf %s\\n '::set-output name=name::${{ github.workflow }} - ${{ github.job }} - Node ${{ matrix.node }}' run: |
printf %s\\n '::set-output name=tunnel_id::${{ github.run_id }}-${{ github.run_number }}-${{ github.job }}-node${{ matrix.node }}' printf %s\\n '::set-output name=name::${{ github.workflow }} - ${{ github.job }} - Node ${{ matrix.node }}'
printf %s\\n '::set-output name=tunnel_id::${{ github.run_id }}-${{ github.run_number }}-${{ github.job }}-node${{ matrix.node }}'
- name: Checkout repository -
uses: actions/checkout@v2 name: Checkout repository
uses: actions/checkout@v2
- uses: actions/setup-node@v2 -
with: uses: actions/setup-node@v2
node-version: ${{ matrix.node }} with:
cache: 'npm' node-version: ${{ matrix.node }}
cache-dependency-path: | cache: 'npm'
src/package-lock.json cache-dependency-path: |
src/bin/doc/package-lock.json src/package-lock.json
src/bin/doc/package-lock.json
- name: Install etherpad plugins -
# We intentionally install an old ep_align version to test upgrades to the minor version number. name: Install etherpad plugins
# The --legacy-peer-deps flag is required to work around a bug in npm v7: # We intentionally install an old ep_align version to test upgrades to
# https://github.com/npm/cli/issues/2199 # the minor version number. The --legacy-peer-deps flag is required to
run: npm install --no-save --legacy-peer-deps ep_align@0.2.27 # work around a bug in npm v7: https://github.com/npm/cli/issues/2199
run: npm install --no-save --legacy-peer-deps ep_align@0.2.27
# This must be run after installing the plugins, otherwise npm will try to # Etherpad core dependencies must be installed after installing the
# hoist common dependencies by removing them from src/node_modules and # plugin's dependencies, otherwise npm will try to hoist common
# installing them in the top-level node_modules. As of v6.14.10, npm's hoist # dependencies by removing them from src/node_modules and installing them
# logic appears to be buggy, because it sometimes removes dependencies from # in the top-level node_modules. As of v6.14.10, npm's hoist logic appears
# src/node_modules but fails to add them to the top-level node_modules. Even # to be buggy, because it sometimes removes dependencies from
# if npm correctly hoists the dependencies, the hoisting seems to confuse # src/node_modules but fails to add them to the top-level node_modules.
# tools such as `npm outdated`, `npm update`, and some ESLint rules. # Even if npm correctly hoists the dependencies, the hoisting seems to
- name: Install all dependencies and symlink for ep_etherpad-lite # confuse tools such as `npm outdated`, `npm update`, and some ESLint
run: src/bin/installDeps.sh # rules.
-
# Nuke plugin tests name: Install all dependencies and symlink for ep_etherpad-lite
- name: Install etherpad plugins run: src/bin/installDeps.sh
run: rm -Rf node_modules/ep_align/static/tests/* -
name: Install etherpad plugins
- name: export GIT_HASH to env run: rm -Rf node_modules/ep_align/static/tests/*
id: environment -
run: echo "::set-output name=sha_short::$(git rev-parse --short ${{ github.sha }})" name: export GIT_HASH to env
id: environment
- name: Create settings.json run: echo "::set-output name=sha_short::$(git rev-parse --short ${{ github.sha }})"
run: cp settings.json.template settings.json -
name: Create settings.json
- name: Write custom settings.json that enables the Admin UI tests run: cp settings.json.template settings.json
run: "sed -i 's/\"enableAdminUITests\": false/\"enableAdminUITests\": true,\\n\"users\":{\"admin\":{\"password\":\"changeme\",\"is_admin\":true}}/' settings.json" -
name: Write custom settings.json that enables the Admin UI tests
- name: increase maxHttpBufferSize run: "sed -i 's/\"enableAdminUITests\": false/\"enableAdminUITests\": true,\\n\"users\":{\"admin\":{\"password\":\"changeme\",\"is_admin\":true}}/' settings.json"
run: "sed -i 's/\"maxHttpBufferSize\": 10000/\"maxHttpBufferSize\": 100000/' settings.json" -
name: increase maxHttpBufferSize
- name: Remove standard frontend test files, so only admin tests are run run: "sed -i 's/\"maxHttpBufferSize\": 10000/\"maxHttpBufferSize\": 100000/' settings.json"
run: mv src/tests/frontend/specs/* /tmp && mv /tmp/admin*.js src/tests/frontend/specs -
name: Remove standard frontend test files, so only admin tests are run
- uses: saucelabs/sauce-connect-action@v2.1.1 run: mv src/tests/frontend/specs/* /tmp && mv /tmp/admin*.js src/tests/frontend/specs
with: -
username: ${{ secrets.SAUCE_USERNAME }} uses: saucelabs/sauce-connect-action@v2.1.1
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }} with:
tunnelIdentifier: ${{ steps.sauce_strings.outputs.tunnel_id }} username: ${{ secrets.SAUCE_USERNAME }}
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
- name: Run the frontend admin tests tunnelIdentifier: ${{ steps.sauce_strings.outputs.tunnel_id }}
shell: bash -
env: name: Run the frontend admin tests
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} shell: bash
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} env:
SAUCE_NAME: ${{ steps.sauce_strings.outputs.name }} SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
TRAVIS_JOB_NUMBER: ${{ steps.sauce_strings.outputs.tunnel_id }} SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
GIT_HASH: ${{ steps.environment.outputs.sha_short }} SAUCE_NAME: ${{ steps.sauce_strings.outputs.name }}
run: | TRAVIS_JOB_NUMBER: ${{ steps.sauce_strings.outputs.tunnel_id }}
src/tests/frontend/travis/adminrunner.sh GIT_HASH: ${{ steps.environment.outputs.sha_short }}
run: |
src/tests/frontend/travis/adminrunner.sh

View file

@ -7,136 +7,138 @@ jobs:
withoutplugins: withoutplugins:
name: without plugins name: without plugins
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Generate Sauce Labs strings -
id: sauce_strings name: Generate Sauce Labs strings
run: | id: sauce_strings
printf %s\\n '::set-output name=name::${{ github.workflow }} - ${{ github.job }}' run: |
printf %s\\n '::set-output name=tunnel_id::${{ github.run_id }}-${{ github.run_number }}-${{ github.job }}' printf %s\\n '::set-output name=name::${{ github.workflow }} - ${{ github.job }}'
printf %s\\n '::set-output name=tunnel_id::${{ github.run_id }}-${{ github.run_number }}-${{ github.job }}'
- name: Checkout repository -
uses: actions/checkout@v2 name: Checkout repository
uses: actions/checkout@v2
- uses: actions/setup-node@v2 -
with: uses: actions/setup-node@v2
node-version: 12 with:
cache: 'npm' node-version: 12
cache-dependency-path: | cache: 'npm'
src/package-lock.json cache-dependency-path: |
src/bin/doc/package-lock.json src/package-lock.json
src/bin/doc/package-lock.json
- name: Install all dependencies and symlink for ep_etherpad-lite -
run: src/bin/installDeps.sh name: Install all dependencies and symlink for ep_etherpad-lite
run: src/bin/installDeps.sh
- name: export GIT_HASH to env -
id: environment name: export GIT_HASH to env
run: echo "::set-output name=sha_short::$(git rev-parse --short ${{ github.sha }})" id: environment
run: echo "::set-output name=sha_short::$(git rev-parse --short ${{ github.sha }})"
- name: Create settings.json -
run: cp settings.json.template settings.json name: Create settings.json
run: cp settings.json.template settings.json
- name: Disable import/export rate limiting -
run: | name: Disable import/export rate limiting
sed -e '/^ *"importExportRateLimiting":/,/^ *\}/ s/"max":.*/"max": 0/' -i settings.json run: |
sed -e '/^ *"importExportRateLimiting":/,/^ *\}/ s/"max":.*/"max": 0/' -i settings.json
- uses: saucelabs/sauce-connect-action@v2.1.1 -
with: uses: saucelabs/sauce-connect-action@v2.1.1
username: ${{ secrets.SAUCE_USERNAME }} with:
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }} username: ${{ secrets.SAUCE_USERNAME }}
tunnelIdentifier: ${{ steps.sauce_strings.outputs.tunnel_id }} accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
tunnelIdentifier: ${{ steps.sauce_strings.outputs.tunnel_id }}
- name: Run the frontend tests -
shell: bash name: Run the frontend tests
env: shell: bash
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} env:
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_NAME: ${{ steps.sauce_strings.outputs.name }} SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
TRAVIS_JOB_NUMBER: ${{ steps.sauce_strings.outputs.tunnel_id }} SAUCE_NAME: ${{ steps.sauce_strings.outputs.name }}
GIT_HASH: ${{ steps.environment.outputs.sha_short }} TRAVIS_JOB_NUMBER: ${{ steps.sauce_strings.outputs.tunnel_id }}
run: | GIT_HASH: ${{ steps.environment.outputs.sha_short }}
src/tests/frontend/travis/runner.sh run: |
src/tests/frontend/travis/runner.sh
withplugins: withplugins:
name: with plugins name: with plugins
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Generate Sauce Labs strings -
id: sauce_strings name: Generate Sauce Labs strings
run: | id: sauce_strings
printf %s\\n '::set-output name=name::${{ github.workflow }} - ${{ github.job }}' run: |
printf %s\\n '::set-output name=tunnel_id::${{ github.run_id }}-${{ github.run_number }}-${{ github.job }}' printf %s\\n '::set-output name=name::${{ github.workflow }} - ${{ github.job }}'
printf %s\\n '::set-output name=tunnel_id::${{ github.run_id }}-${{ github.run_number }}-${{ github.job }}'
- name: Checkout repository -
uses: actions/checkout@v2 name: Checkout repository
uses: actions/checkout@v2
- uses: actions/setup-node@v2 -
with: uses: actions/setup-node@v2
node-version: 12 with:
cache: 'npm' node-version: 12
cache-dependency-path: | cache: 'npm'
src/package-lock.json cache-dependency-path: |
src/bin/doc/package-lock.json 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: name: Install Etherpad plugins
# https://github.com/npm/cli/issues/2199 # The --legacy-peer-deps flag is required to work around a bug in npm v7:
run: > # https://github.com/npm/cli/issues/2199
npm install --no-save --legacy-peer-deps run: >
ep_align npm install --no-save --legacy-peer-deps
ep_author_hover ep_align
ep_cursortrace ep_author_hover
ep_embedmedia ep_cursortrace
ep_font_size ep_embedmedia
ep_hash_auth ep_font_size
ep_headings2 ep_hash_auth
ep_image_upload ep_headings2
ep_markdown ep_image_upload
ep_readonly_guest ep_markdown
ep_set_title_on_pad ep_readonly_guest
ep_spellcheck ep_set_title_on_pad
ep_subscript_and_superscript ep_spellcheck
ep_table_of_contents ep_subscript_and_superscript
ep_table_of_contents
# This must be run after installing the plugins, otherwise npm will try to # Etherpad core dependencies must be installed after installing the
# hoist common dependencies by removing them from src/node_modules and # plugin's dependencies, otherwise npm will try to hoist common
# installing them in the top-level node_modules. As of v6.14.10, npm's hoist # dependencies by removing them from src/node_modules and installing them
# logic appears to be buggy, because it sometimes removes dependencies from # in the top-level node_modules. As of v6.14.10, npm's hoist logic appears
# src/node_modules but fails to add them to the top-level node_modules. Even # to be buggy, because it sometimes removes dependencies from
# if npm correctly hoists the dependencies, the hoisting seems to confuse # src/node_modules but fails to add them to the top-level node_modules.
# tools such as `npm outdated`, `npm update`, and some ESLint rules. # Even if npm correctly hoists the dependencies, the hoisting seems to
- name: Install all dependencies and symlink for ep_etherpad-lite # confuse tools such as `npm outdated`, `npm update`, and some ESLint
run: src/bin/installDeps.sh # rules.
-
- name: export GIT_HASH to env name: Install all dependencies and symlink for ep_etherpad-lite
id: environment run: src/bin/installDeps.sh
run: echo "::set-output name=sha_short::$(git rev-parse --short ${{ github.sha }})" -
name: export GIT_HASH to env
- name: Create settings.json id: environment
run: cp settings.json.template settings.json run: echo "::set-output name=sha_short::$(git rev-parse --short ${{ github.sha }})"
-
- name: Disable import/export rate limiting name: Create settings.json
run: | run: cp settings.json.template settings.json
sed -e '/^ *"importExportRateLimiting":/,/^ *\}/ s/"max":.*/"max": 0/' -i settings.json -
name: Disable import/export rate limiting
run: |
sed -e '/^ *"importExportRateLimiting":/,/^ *\}/ s/"max":.*/"max": 0/' -i settings.json
# XXX we should probably run all tests, because plugins could effect their results # XXX we should probably run all tests, because plugins could effect their results
- name: Remove standard frontend test files, so only plugin tests are run -
run: rm src/tests/frontend/specs/* name: Remove standard frontend test files, so only plugin tests are run
run: rm src/tests/frontend/specs/*
- uses: saucelabs/sauce-connect-action@v2.1.1 -
with: uses: saucelabs/sauce-connect-action@v2.1.1
username: ${{ secrets.SAUCE_USERNAME }} with:
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }} username: ${{ secrets.SAUCE_USERNAME }}
tunnelIdentifier: ${{ steps.sauce_strings.outputs.tunnel_id }} accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
tunnelIdentifier: ${{ steps.sauce_strings.outputs.tunnel_id }}
- name: Run the frontend tests -
shell: bash name: Run the frontend tests
env: shell: bash
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} env:
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_NAME: ${{ steps.sauce_strings.outputs.name }} SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
TRAVIS_JOB_NUMBER: ${{ steps.sauce_strings.outputs.tunnel_id }} SAUCE_NAME: ${{ steps.sauce_strings.outputs.name }}
GIT_HASH: ${{ steps.environment.outputs.sha_short }} TRAVIS_JOB_NUMBER: ${{ steps.sauce_strings.outputs.tunnel_id }}
run: | GIT_HASH: ${{ steps.environment.outputs.sha_short }}
src/tests/frontend/travis/runner.sh run: |
src/tests/frontend/travis/runner.sh

View file

@ -8,31 +8,31 @@ jobs:
# run on pushes to any branch # run on pushes to any branch
# run on PRs from external forks # run on PRs from external forks
if: | if: |
(github.event_name != 'pull_request') (github.event_name != 'pull_request')
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id) || (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
name: package-lock.json name: package-lock.json
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository -
uses: actions/checkout@v2 name: Checkout repository
uses: actions/checkout@v2
- uses: actions/setup-node@v2 -
with: uses: actions/setup-node@v2
node-version: 12 with:
cache: 'npm' node-version: 12
cache-dependency-path: | cache: 'npm'
src/package-lock.json cache-dependency-path: |
src/bin/doc/package-lock.json src/package-lock.json
src/bin/doc/package-lock.json
- name: Install lockfile-lint -
run: npm install --no-save lockfile-lint name: Install lockfile-lint
run: npm install --no-save lockfile-lint
- name: Run lockfile-lint on package-lock.json -
run: > name: Run lockfile-lint on package-lock.json
npx lockfile-lint run: >
--path src/package-lock.json npx lockfile-lint
--allowed-hosts npm --path src/package-lock.json
--allowed-schemes https: --allowed-hosts npm
--allowed-schemes github: --allowed-schemes https:
--allowed-urls github:mapbox/node-sqlite3#593c9d498be2510d286349134537e3bf89401c4a --allowed-schemes github:
--allowed-urls github:mapbox/node-sqlite3#593c9d498be2510d286349134537e3bf89401c4a

View file

@ -8,116 +8,115 @@ jobs:
# run on pushes to any branch # run on pushes to any branch
# run on PRs from external forks # run on PRs from external forks
if: | if: |
(github.event_name != 'pull_request') (github.event_name != 'pull_request')
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id) || (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
name: without plugins name: without plugins
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository -
uses: actions/checkout@v2 name: Checkout repository
uses: actions/checkout@v2
- uses: actions/setup-node@v2 -
with: uses: actions/setup-node@v2
node-version: 12 with:
cache: 'npm' node-version: 12
cache-dependency-path: | cache: 'npm'
src/package-lock.json cache-dependency-path: |
src/bin/doc/package-lock.json src/package-lock.json
src/bin/doc/package-lock.json
- name: Install all dependencies and symlink for ep_etherpad-lite -
run: src/bin/installDeps.sh name: Install all dependencies and symlink for ep_etherpad-lite
run: src/bin/installDeps.sh
- name: Install etherpad-load-test -
run: sudo npm install -g etherpad-load-test name: Install etherpad-load-test
run: sudo npm install -g etherpad-load-test
- name: Run load test -
run: src/tests/frontend/travis/runnerLoadTest.sh 25 50 name: Run load test
run: src/tests/frontend/travis/runnerLoadTest.sh 25 50
withplugins: withplugins:
# run on pushes to any branch # run on pushes to any branch
# run on PRs from external forks # run on PRs from external forks
if: | if: |
(github.event_name != 'pull_request') (github.event_name != 'pull_request')
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id) || (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
name: with Plugins name: with Plugins
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository -
uses: actions/checkout@v2 name: Checkout repository
uses: actions/checkout@v2
- uses: actions/setup-node@v2 -
with: uses: actions/setup-node@v2
node-version: 12 with:
cache: 'npm' node-version: 12
cache-dependency-path: | cache: 'npm'
src/package-lock.json cache-dependency-path: |
src/bin/doc/package-lock.json src/package-lock.json
src/bin/doc/package-lock.json
- name: Install etherpad-load-test -
run: sudo npm install -g etherpad-load-test name: Install etherpad-load-test
run: sudo npm install -g etherpad-load-test
- name: Install etherpad plugins -
# The --legacy-peer-deps flag is required to work around a bug in npm v7: name: Install etherpad plugins
# https://github.com/npm/cli/issues/2199 # The --legacy-peer-deps flag is required to work around a bug in npm v7:
run: > # https://github.com/npm/cli/issues/2199
npm install --no-save --legacy-peer-deps run: >
ep_align npm install --no-save --legacy-peer-deps
ep_author_hover ep_align
ep_cursortrace ep_author_hover
ep_font_size ep_cursortrace
ep_hash_auth ep_font_size
ep_headings2 ep_hash_auth
ep_markdown ep_headings2
ep_readonly_guest ep_markdown
ep_set_title_on_pad ep_readonly_guest
ep_spellcheck ep_set_title_on_pad
ep_subscript_and_superscript ep_spellcheck
ep_table_of_contents ep_subscript_and_superscript
ep_table_of_contents
# This must be run after installing the plugins, otherwise npm will try to # Etherpad core dependencies must be installed after installing the
# hoist common dependencies by removing them from src/node_modules and # plugin's dependencies, otherwise npm will try to hoist common
# installing them in the top-level node_modules. As of v6.14.10, npm's hoist # dependencies by removing them from src/node_modules and installing them
# logic appears to be buggy, because it sometimes removes dependencies from # in the top-level node_modules. As of v6.14.10, npm's hoist logic appears
# src/node_modules but fails to add them to the top-level node_modules. Even # to be buggy, because it sometimes removes dependencies from
# if npm correctly hoists the dependencies, the hoisting seems to confuse # src/node_modules but fails to add them to the top-level node_modules.
# tools such as `npm outdated`, `npm update`, and some ESLint rules. # Even if npm correctly hoists the dependencies, the hoisting seems to
- name: Install all dependencies and symlink for ep_etherpad-lite # confuse tools such as `npm outdated`, `npm update`, and some ESLint
run: src/bin/installDeps.sh # rules.
-
# configures some settings and runs npm run test name: Install all dependencies and symlink for ep_etherpad-lite
- name: Run load test run: src/bin/installDeps.sh
run: src/tests/frontend/travis/runnerLoadTest.sh 25 50 -
name: Run load test
run: src/tests/frontend/travis/runnerLoadTest.sh 25 50
long: long:
# run on pushes to any branch # run on pushes to any branch
# run on PRs from external forks # run on PRs from external forks
if: | if: |
(github.event_name != 'pull_request') (github.event_name != 'pull_request')
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id) || (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
name: long running name: long running
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository -
uses: actions/checkout@v2 name: Checkout repository
uses: actions/checkout@v2
- uses: actions/setup-node@v2 -
with: uses: actions/setup-node@v2
node-version: 12 with:
cache: 'npm' node-version: 12
cache-dependency-path: | cache: 'npm'
src/package-lock.json cache-dependency-path: |
src/bin/doc/package-lock.json src/package-lock.json
src/bin/doc/package-lock.json
- name: Install all dependencies and symlink for ep_etherpad-lite -
run: src/bin/installDeps.sh name: Install all dependencies and symlink for ep_etherpad-lite
run: src/bin/installDeps.sh
- name: Install etherpad-load-test -
run: sudo npm install -g etherpad-load-test name: Install etherpad-load-test
run: sudo npm install -g etherpad-load-test
-
# configures some settings and runs npm run test name: Run load test
- name: Run load test run: src/tests/frontend/travis/runnerLoadTest.sh 5000 5
run: src/tests/frontend/travis/runnerLoadTest.sh 5000 5

View file

@ -8,40 +8,42 @@ jobs:
# run on pushes to any branch # run on pushes to any branch
# run on PRs from external forks # run on PRs from external forks
if: | if: |
(github.event_name != 'pull_request') (github.event_name != 'pull_request')
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id) || (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
name: test name: test
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository -
uses: actions/checkout@v2 name: Checkout repository
uses: actions/checkout@v2
- uses: actions/setup-node@v2 -
with: uses: actions/setup-node@v2
node-version: 12 with:
cache: 'npm' node-version: 12
cache-dependency-path: | cache: 'npm'
src/package-lock.json cache-dependency-path: |
src/bin/doc/package-lock.json src/package-lock.json
src/bin/doc/package-lock.json
- name: docker network -
run: docker network create --subnet=172.23.42.0/16 ep_net name: docker network
run: docker network create --subnet=172.23.42.0/16 ep_net
- name: build docker image -
run: | name: build docker image
docker build -f Dockerfile -t epl-debian-slim . run: |
docker build -f src/tests/ratelimit/Dockerfile.nginx -t nginx-latest . docker build -f Dockerfile -t epl-debian-slim .
docker build -f src/tests/ratelimit/Dockerfile.anotherip -t anotherip . docker build -f src/tests/ratelimit/Dockerfile.nginx -t nginx-latest .
- name: run docker images docker build -f src/tests/ratelimit/Dockerfile.anotherip -t anotherip .
run: | -
docker run --name etherpad-docker -p 9000:9001 --rm --network ep_net --ip 172.23.42.2 -e 'TRUST_PROXY=true' epl-debian-slim & name: run docker images
docker run -p 8081:80 --rm --network ep_net --ip 172.23.42.1 -d nginx-latest run: |
docker run --rm --network ep_net --ip 172.23.42.3 --name anotherip -dt anotherip docker run --name etherpad-docker -p 9000:9001 --rm --network ep_net --ip 172.23.42.2 -e 'TRUST_PROXY=true' epl-debian-slim &
docker run -p 8081:80 --rm --network ep_net --ip 172.23.42.1 -d nginx-latest
- name: install dependencies and create symlink for ep_etherpad-lite docker run --rm --network ep_net --ip 172.23.42.3 --name anotherip -dt anotherip
run: src/bin/installDeps.sh -
name: install dependencies and create symlink for ep_etherpad-lite
- name: run rate limit test run: src/bin/installDeps.sh
run: | -
cd src/tests/ratelimit name: run rate limit test
./testlimits.sh run: |
cd src/tests/ratelimit
./testlimits.sh

View file

@ -8,88 +8,90 @@ jobs:
# run on pushes to any branch # run on pushes to any branch
# run on PRs from external forks # run on PRs from external forks
if: | if: |
(github.event_name != 'pull_request') (github.event_name != 'pull_request')
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id) || (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
name: Linux with Plugins name: Linux with Plugins
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
node: [12, 14, 16] node: [12, 14, 16]
steps: steps:
- name: Check out latest release -
uses: actions/checkout@v2 name: Check out latest release
with: uses: actions/checkout@v2
ref: master with:
ref: master
- uses: actions/setup-node@v2 -
with: uses: actions/setup-node@v2
node-version: ${{ matrix.node }} with:
cache: 'npm' node-version: ${{ matrix.node }}
cache-dependency-path: | cache: 'npm'
src/package-lock.json cache-dependency-path: |
src/bin/doc/package-lock.json 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: name: Install Etherpad plugins
# https://github.com/npm/cli/issues/2199 # The --legacy-peer-deps flag is required to work around a bug in npm
run: > # v7: https://github.com/npm/cli/issues/2199
npm install --no-save --legacy-peer-deps run: >
ep_align npm install --no-save --legacy-peer-deps
ep_author_hover ep_align
ep_cursortrace ep_author_hover
ep_font_size ep_cursortrace
ep_hash_auth ep_font_size
ep_headings2 ep_hash_auth
ep_image_upload ep_headings2
ep_markdown ep_image_upload
ep_readonly_guest ep_markdown
ep_set_title_on_pad ep_readonly_guest
ep_spellcheck ep_set_title_on_pad
ep_subscript_and_superscript ep_spellcheck
ep_table_of_contents ep_subscript_and_superscript
ep_table_of_contents
# This must be run after installing the plugins, otherwise npm will try to # Etherpad core dependencies must be installed after installing the
# hoist common dependencies by removing them from src/node_modules and # plugin's dependencies, otherwise npm will try to hoist common
# installing them in the top-level node_modules. As of v6.14.10, npm's hoist # dependencies by removing them from src/node_modules and installing them
# logic appears to be buggy, because it sometimes removes dependencies from # in the top-level node_modules. As of v6.14.10, npm's hoist logic appears
# src/node_modules but fails to add them to the top-level node_modules. Even # to be buggy, because it sometimes removes dependencies from
# if npm correctly hoists the dependencies, the hoisting seems to confuse # src/node_modules but fails to add them to the top-level node_modules.
# tools such as `npm outdated`, `npm update`, and some ESLint rules. # Even if npm correctly hoists the dependencies, the hoisting seems to
- name: Install all dependencies and symlink for ep_etherpad-lite # confuse tools such as `npm outdated`, `npm update`, and some ESLint
run: src/bin/installDeps.sh # rules.
-
- name: Run the backend tests name: Install all dependencies and symlink for ep_etherpad-lite
run: cd src && npm test run: src/bin/installDeps.sh
-
# Because actions/checkout@v2 is called with "ref: master" and without name: Run the backend tests
# "fetch-depth: 0", the local clone does not have the ${GITHUB_SHA} commit. run: cd src && npm test
# Fetch ${GITHUB_REF} to get the ${GITHUB_SHA} commit. Note that a plain # Because actions/checkout@v2 is called with "ref: master" and without
# "git fetch" only fetches "normal" references (refs/heads/* and # "fetch-depth: 0", the local clone does not have the ${GITHUB_SHA}
# refs/tags/*), and for pull requests none of the normal references include # commit. Fetch ${GITHUB_REF} to get the ${GITHUB_SHA} commit. Note that a
# ${GITHUB_SHA}, so we have to explicitly tell Git to fetch ${GITHUB_REF}. # plain "git fetch" only fetches "normal" references (refs/heads/* and
- name: Fetch the new Git commits # refs/tags/*), and for pull requests none of the normal references
run: git fetch --depth=1 origin "${GITHUB_REF}" # include ${GITHUB_SHA}, so we have to explicitly tell Git to fetch
# ${GITHUB_REF}.
- name: Upgrade to the new Git revision -
# For pull requests, ${GITHUB_SHA} is the automatically generated merge name: Fetch the new Git commits
# commit that merges the PR's source branch to its destination branch. run: git fetch --depth=1 origin "${GITHUB_REF}"
run: git checkout "${GITHUB_SHA}" -
name: Upgrade to the new Git revision
- name: Install all dependencies and symlink for ep_etherpad-lite # For pull requests, ${GITHUB_SHA} is the automatically generated merge
run: src/bin/installDeps.sh # commit that merges the PR's source branch to its destination branch.
run: git checkout "${GITHUB_SHA}"
- name: Run the backend tests -
run: cd src && npm test name: Install all dependencies and symlink for ep_etherpad-lite
run: src/bin/installDeps.sh
- name: Install Cypress -
run: npm install cypress -g name: Run the backend tests
run: cd src && npm test
- name: Run Etherpad & Test Frontend -
run: | name: Install Cypress
node src/node/server.js & run: npm install cypress -g
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 -
cd src/tests/frontend name: Run Etherpad & Test Frontend
cypress run --spec cypress/integration/test.js --config-file cypress/cypress.json 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
cd src/tests/frontend
cypress run --spec cypress/integration/test.js --config-file cypress/cypress.json

View file

@ -8,58 +8,57 @@ jobs:
# run on pushes to any branch # run on pushes to any branch
# run on PRs from external forks # run on PRs from external forks
if: | if: |
(github.event_name != 'pull_request') (github.event_name != 'pull_request')
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id) || (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
name: Build Zip & Exe name: Build Zip & Exe
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- uses: msys2/setup-msys2@v2 -
with: uses: msys2/setup-msys2@v2
path-type: inherit with:
install: >- path-type: inherit
zip install: >-
zip
- name: Checkout repository -
uses: actions/checkout@v2 name: Checkout repository
uses: actions/checkout@v2
- uses: actions/setup-node@v2 -
with: uses: actions/setup-node@v2
node-version: 12 with:
cache: 'npm' node-version: 12
cache-dependency-path: | cache: 'npm'
src/package-lock.json cache-dependency-path: |
src/bin/doc/package-lock.json src/package-lock.json
src/bin/doc/package-lock.json
- name: Install all dependencies and symlink for ep_etherpad-lite -
shell: msys2 {0} name: Install all dependencies and symlink for ep_etherpad-lite
run: src/bin/installDeps.sh shell: msys2 {0}
run: src/bin/installDeps.sh
- name: Run the backend tests -
shell: msys2 {0} name: Run the backend tests
run: cd src && npm test shell: msys2 {0}
run: cd src && npm test
- name: Build the .zip -
shell: msys2 {0} name: Build the .zip
run: src/bin/buildForWindows.sh shell: msys2 {0}
run: src/bin/buildForWindows.sh
- name: Extract the .zip into folder -
run: 7z x etherpad-lite-win.zip -oetherpad-lite-new name: Extract the .zip into folder
run: 7z x etherpad-lite-win.zip -oetherpad-lite-new
- name: Grab nsis config -
run: git clone https://github.com/ether/etherpad_nsis.git name: Grab nsis config
run: git clone https://github.com/ether/etherpad_nsis.git
- name: Create installer -
uses: joncloud/makensis-action@v3.6 name: Create installer
with: uses: joncloud/makensis-action@v3.6
script-file: 'etherpad_nsis/etherpad.nsi' with:
script-file: 'etherpad_nsis/etherpad.nsi'
- name: Check something.. -
run: ls etherpad_nsis name: Check something..
run: ls etherpad_nsis
- name: Archive production artifacts -
uses: actions/upload-artifact@v2 name: Archive production artifacts
with: uses: actions/upload-artifact@v2
name: etherpad-server-windows.exe with:
path: etherpad_nsis/etherpad-server-windows.exe name: etherpad-server-windows.exe
path: etherpad_nsis/etherpad-server-windows.exe

View file

@ -8,82 +8,81 @@ jobs:
# run on pushes to any branch # run on pushes to any branch
# run on PRs from external forks # run on PRs from external forks
if: | if: |
(github.event_name != 'pull_request') (github.event_name != 'pull_request')
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id) || (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
name: Build name: Build
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- uses: msys2/setup-msys2@v2 -
with: uses: msys2/setup-msys2@v2
path-type: inherit with:
install: >- path-type: inherit
zip install: >-
zip
- name: Checkout repository -
uses: actions/checkout@v2 name: Checkout repository
uses: actions/checkout@v2
- uses: actions/setup-node@v2 -
with: uses: actions/setup-node@v2
node-version: 12 with:
cache: 'npm' node-version: 12
cache-dependency-path: | cache: 'npm'
src/package-lock.json cache-dependency-path: |
src/bin/doc/package-lock.json src/package-lock.json
src/bin/doc/package-lock.json
- name: Install all dependencies and symlink for ep_etherpad-lite -
shell: msys2 {0} name: Install all dependencies and symlink for ep_etherpad-lite
run: src/bin/installDeps.sh shell: msys2 {0}
run: src/bin/installDeps.sh
- name: Run the backend tests -
shell: msys2 {0} name: Run the backend tests
run: cd src && npm test shell: msys2 {0}
run: cd src && npm test
- name: Build the .zip -
shell: msys2 {0} name: Build the .zip
run: src/bin/buildForWindows.sh shell: msys2 {0}
run: src/bin/buildForWindows.sh
- name: Archive production artifacts -
uses: actions/upload-artifact@v2 name: Archive production artifacts
with: uses: actions/upload-artifact@v2
name: etherpad-lite-win.zip with:
path: etherpad-lite-win.zip name: etherpad-lite-win.zip
path: etherpad-lite-win.zip
deploy: deploy:
# run on pushes to any branch # run on pushes to any branch
# run on PRs from external forks # run on PRs from external forks
if: | if: |
(github.event_name != 'pull_request') (github.event_name != 'pull_request')
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id) || (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
name: Deploy name: Deploy
needs: build needs: build
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- name: Download zip -
uses: actions/download-artifact@v2 name: Download zip
with: uses: actions/download-artifact@v2
name: etherpad-lite-win.zip with:
name: etherpad-lite-win.zip
- name: Extract Etherpad -
run: 7z x etherpad-lite-win.zip -oetherpad name: Extract Etherpad
run: 7z x etherpad-lite-win.zip -oetherpad
- uses: actions/setup-node@v2 -
with: uses: actions/setup-node@v2
node-version: 12 with:
cache: 'npm' node-version: 12
cache-dependency-path: | cache: 'npm'
etherpad/src/package-lock.json cache-dependency-path: |
etherpad/src/bin/doc/package-lock.json etherpad/src/package-lock.json
etherpad/src/bin/doc/package-lock.json
- name: Install Cypress -
run: npm install cypress -g name: Install Cypress
run: npm install cypress -g
- name: Run Etherpad -
run: | name: Run Etherpad
cd etherpad run: |
node node_modules\ep_etherpad-lite\node\server.js & cd etherpad
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 node node_modules\ep_etherpad-lite\node\server.js &
cd src\tests\frontend 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
cypress run --spec cypress\integration\test.js --config-file cypress\cypress.json cd src\tests\frontend
cypress run --spec cypress\integration\test.js --config-file cypress\cypress.json

View file

@ -8,66 +8,68 @@ jobs:
# run on pushes to any branch # run on pushes to any branch
# run on PRs from external forks # run on PRs from external forks
if: | if: |
(github.event_name != 'pull_request') (github.event_name != 'pull_request')
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id) || (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
name: with Plugins name: with Plugins
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Install libreoffice -
run: | name: Install libreoffice
sudo add-apt-repository -y ppa:libreoffice/ppa run: |
sudo apt update sudo add-apt-repository -y ppa:libreoffice/ppa
sudo apt install -y --no-install-recommends libreoffice libreoffice-pdfimport sudo apt update
sudo apt install -y --no-install-recommends libreoffice libreoffice-pdfimport
# clone etherpad-lite -
- name: Install etherpad core name: Install etherpad core
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
repository: ether/etherpad-lite repository: ether/etherpad-lite
-
- name: Checkout plugin repository name: Checkout plugin repository
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
path: ./node_modules/__tmp path: ./node_modules/__tmp
-
- name: Determine plugin name name: Determine plugin name
id: plugin_name id: plugin_name
run: | run: |
cd ./node_modules/__tmp cd ./node_modules/__tmp
npx -c 'printf %s\\n "::set-output name=plugin_name::${npm_package_name}"' npx -c 'printf %s\\n "::set-output name=plugin_name::${npm_package_name}"'
-
- name: Rename plugin directory name: Rename plugin directory
run: | run: |
mv ./node_modules/__tmp ./node_modules/"${PLUGIN_NAME}" mv ./node_modules/__tmp ./node_modules/"${PLUGIN_NAME}"
env: env:
PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }} PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }}
-
- uses: actions/setup-node@v2 uses: actions/setup-node@v2
with: with:
node-version: 12 node-version: 12
cache: 'npm' cache: 'npm'
cache-dependency-path: | cache-dependency-path: |
src/package-lock.json src/package-lock.json
src/bin/doc/package-lock.json src/bin/doc/package-lock.json
node_modules/${{ steps.plugin_name.outputs.plugin_name }}/package-lock.json node_modules/${{ steps.plugin_name.outputs.plugin_name }}/package-lock.json
-
- name: Install plugin dependencies name: Install plugin dependencies
run: | run: |
cd ./node_modules/"${PLUGIN_NAME}" cd ./node_modules/"${PLUGIN_NAME}"
npm ci npm ci
env: env:
PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }} PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }}
# Etherpad core dependencies must be installed after installing the
# This must be run after setting up the plugin, otherwise npm will try to # plugin's dependencies, otherwise npm will try to hoist common
# hoist common dependencies by removing them from src/node_modules and # dependencies by removing them from src/node_modules and installing them
# installing them in the top-level node_modules. As of v6.14.10, npm's hoist # in the top-level node_modules. As of v6.14.10, npm's hoist logic appears
# logic appears to be buggy, because it sometimes removes dependencies from # to be buggy, because it sometimes removes dependencies from
# src/node_modules but fails to add them to the top-level node_modules. Even # src/node_modules but fails to add them to the top-level node_modules.
# if npm correctly hoists the dependencies, the hoisting seems to confuse # Even if npm correctly hoists the dependencies, the hoisting seems to
# tools such as `npm outdated`, `npm update`, and some ESLint rules. # confuse tools such as `npm outdated`, `npm update`, and some ESLint
- name: Install Etherpad core dependencies # rules.
run: src/bin/installDeps.sh -
name: Install Etherpad core dependencies
- name: Run the backend tests run: src/bin/installDeps.sh
run: cd src && npm test -
name: Run the backend tests
run: cd src && npm test

View file

@ -9,88 +9,91 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Generate Sauce Labs strings -
id: sauce_strings name: Generate Sauce Labs strings
run: | id: sauce_strings
printf %s\\n '::set-output name=name::${{github.event.repository.name}} ${{ github.workflow }} - ${{ github.job }}' run: |
printf %s\\n '::set-output name=tunnel_id::${{ github.run_id }}-${{ github.run_number }}-${{ github.job }}' printf %s\\n '::set-output name=name::${{github.event.repository.name}} ${{ github.workflow }} - ${{ github.job }}'
printf %s\\n '::set-output name=tunnel_id::${{ github.run_id }}-${{ github.run_number }}-${{ github.job }}'
- name: Check out Etherpad core -
uses: actions/checkout@v2 name: Check out Etherpad core
with: uses: actions/checkout@v2
repository: ether/etherpad-lite with:
repository: ether/etherpad-lite
- uses: actions/setup-node@v2 -
with: uses: actions/setup-node@v2
node-version: 12 with:
cache: 'npm' node-version: 12
cache-dependency-path: | cache: 'npm'
src/package-lock.json cache-dependency-path: |
src/bin/doc/package-lock.json src/package-lock.json
src/bin/doc/package-lock.json
- name: Check out the plugin -
uses: actions/checkout@v2 name: Check out the plugin
with: uses: actions/checkout@v2
path: ./node_modules/__tmp with:
path: ./node_modules/__tmp
- name: export GIT_HASH to env -
id: environment name: export GIT_HASH to env
run: | id: environment
cd ./node_modules/__tmp run: |
echo "::set-output name=sha_short::$(git rev-parse --short ${{ github.sha }})" cd ./node_modules/__tmp
echo "::set-output name=sha_short::$(git rev-parse --short ${{ github.sha }})"
- name: Determine plugin name -
id: plugin_name name: Determine plugin name
run: | id: plugin_name
cd ./node_modules/__tmp run: |
npx -c 'printf %s\\n "::set-output name=plugin_name::${npm_package_name}"' cd ./node_modules/__tmp
npx -c 'printf %s\\n "::set-output name=plugin_name::${npm_package_name}"'
- name: Rename plugin directory -
env: name: Rename plugin directory
PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }} env:
run: | PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }}
mv ./node_modules/__tmp ./node_modules/"${PLUGIN_NAME}" run: |
mv ./node_modules/__tmp ./node_modules/"${PLUGIN_NAME}"
- name: Install plugin dependencies -
env: name: Install plugin dependencies
PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }} env:
run: | PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }}
cd ./node_modules/"${PLUGIN_NAME}" run: |
npm ci cd ./node_modules/"${PLUGIN_NAME}"
npm ci
# This must be run after setting up the plugin, otherwise npm will try to # Etherpad core dependencies must be installed after installing the
# hoist common dependencies by removing them from src/node_modules and # plugin's dependencies, otherwise npm will try to hoist common
# installing them in the top-level node_modules. As of v6.14.10, npm's hoist # dependencies by removing them from src/node_modules and installing them
# logic appears to be buggy, because it sometimes removes dependencies from # in the top-level node_modules. As of v6.14.10, npm's hoist logic appears
# src/node_modules but fails to add them to the top-level node_modules. Even # to be buggy, because it sometimes removes dependencies from
# if npm correctly hoists the dependencies, the hoisting seems to confuse # src/node_modules but fails to add them to the top-level node_modules.
# tools such as `npm outdated`, `npm update`, and some ESLint rules. # Even if npm correctly hoists the dependencies, the hoisting seems to
- name: Install Etherpad core dependencies # confuse tools such as `npm outdated`, `npm update`, and some ESLint
run: src/bin/installDeps.sh # rules.
-
- name: Create settings.json name: Install Etherpad core dependencies
run: cp settings.json.template settings.json run: src/bin/installDeps.sh
-
- name: Disable import/export rate limiting name: Create settings.json
run: | run: cp settings.json.template settings.json
sed -e '/^ *"importExportRateLimiting":/,/^ *\}/ s/"max":.*/"max": 0/' -i settings.json -
name: Disable import/export rate limiting
- name: Remove standard frontend test files run: |
run: rm -rf src/tests/frontend/specs sed -e '/^ *"importExportRateLimiting":/,/^ *\}/ s/"max":.*/"max": 0/' -i settings.json
-
- uses: saucelabs/sauce-connect-action@v2.1.1 name: Remove standard frontend test files
with: run: rm -rf src/tests/frontend/specs
username: ${{ secrets.SAUCE_USERNAME }} -
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }} uses: saucelabs/sauce-connect-action@v2.1.1
tunnelIdentifier: ${{ steps.sauce_strings.outputs.tunnel_id }} with:
username: ${{ secrets.SAUCE_USERNAME }}
- name: Run the frontend tests accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
shell: bash tunnelIdentifier: ${{ steps.sauce_strings.outputs.tunnel_id }}
env: -
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} name: Run the frontend tests
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} shell: bash
SAUCE_NAME: ${{ steps.sauce_strings.outputs.name }} env:
TRAVIS_JOB_NUMBER: ${{ steps.sauce_strings.outputs.tunnel_id }} SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
GIT_HASH: ${{ steps.environment.outputs.sha_short }} SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
run: | SAUCE_NAME: ${{ steps.sauce_strings.outputs.name }}
src/tests/frontend/travis/runner.sh TRAVIS_JOB_NUMBER: ${{ steps.sauce_strings.outputs.tunnel_id }}
GIT_HASH: ${{ steps.environment.outputs.sha_short }}
run: |
src/tests/frontend/travis/runner.sh

View file

@ -21,21 +21,26 @@ jobs:
# cloned to etherpad-lite then moved to ../etherpad-lite. To avoid # cloned to etherpad-lite then moved to ../etherpad-lite. To avoid
# conflicts with this plugin's clone, etherpad-lite must be cloned and # conflicts with this plugin's clone, etherpad-lite must be cloned and
# moved out before this plugin's repo is cloned to $GITHUB_WORKSPACE. # moved out before this plugin's repo is cloned to $GITHUB_WORKSPACE.
- uses: actions/checkout@v2 -
uses: actions/checkout@v2
with: with:
repository: ether/etherpad-lite repository: ether/etherpad-lite
path: etherpad-lite path: etherpad-lite
- run: mv etherpad-lite .. -
run: mv etherpad-lite ..
# etherpad-lite has been moved outside of $GITHUB_WORKSPACE, so it is now # etherpad-lite has been moved outside of $GITHUB_WORKSPACE, so it is now
# safe to clone this plugin's repo to $GITHUB_WORKSPACE. # safe to clone this plugin's repo to $GITHUB_WORKSPACE.
- uses: actions/checkout@v2 -
uses: actions/checkout@v2
# This is necessary for actions/setup-node because '..' can't be used in # This is necessary for actions/setup-node because '..' can't be used in
# cache-dependency-path. # cache-dependency-path.
- name: Create ep_etherpad-lite symlink -
name: Create ep_etherpad-lite symlink
run: | run: |
mkdir -p node_modules mkdir -p node_modules
ln -s ../../etherpad-lite/src node_modules/ep_etherpad-lite ln -s ../../etherpad-lite/src node_modules/ep_etherpad-lite
- uses: actions/setup-node@v2 -
uses: actions/setup-node@v2
with: with:
node-version: 12 node-version: 12
cache: 'npm' cache: 'npm'
@ -49,32 +54,40 @@ jobs:
# Etherpad plugins from piggybacking off of ep_etherpad-lite's # Etherpad plugins from piggybacking off of ep_etherpad-lite's
# devDependencies. If we had that, we could change this line to only # devDependencies. If we had that, we could change this line to only
# install production dependencies. # install production dependencies.
- run: cd ../etherpad-lite/src && npm ci -
- run: npm ci run: cd ../etherpad-lite/src && npm ci
-
run: npm ci
# This runs some sanity checks and creates a symlink at # This runs some sanity checks and creates a symlink at
# node_modules/ep_etherpad-lite that points to ../../etherpad-lite/src. # node_modules/ep_etherpad-lite that points to ../../etherpad-lite/src.
# This step must be done after `npm ci` installs the plugin's dependencies # This step must be done after `npm ci` installs the plugin's dependencies
# because npm "helpfully" cleans up such symlinks. :( Installing # because npm "helpfully" cleans up such symlinks. :( Installing
# ep_etherpad-lite in the plugin's node_modules prevents lint errors and # ep_etherpad-lite in the plugin's node_modules prevents lint errors and
# unit test failures if the plugin does `require('ep_etherpad-lite/foo')`. # unit test failures if the plugin does `require('ep_etherpad-lite/foo')`.
- run: npm install --no-save ep_etherpad-lite@file:../etherpad-lite/src -
- run: npm test run: npm install --no-save ep_etherpad-lite@file:../etherpad-lite/src
- run: npm run lint -
run: npm test
-
run: npm run lint
publish-npm: publish-npm:
if: github.event_name == 'push' if: github.event_name == 'push'
needs: test needs: test
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 -
uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: actions/setup-node@v2 -
uses: actions/setup-node@v2
with: with:
node-version: 12 node-version: 12
registry-url: https://registry.npmjs.org/ registry-url: https://registry.npmjs.org/
cache: 'npm' cache: 'npm'
- name: Bump version (patch) -
name: Bump version (patch)
run: | run: |
LATEST_TAG=$(git describe --tags --abbrev=0) || exit 1 LATEST_TAG=$(git describe --tags --abbrev=0) || exit 1
NEW_COMMITS=$(git rev-list --count "${LATEST_TAG}"..) || exit 1 NEW_COMMITS=$(git rev-list --count "${LATEST_TAG}"..) || exit 1
@ -94,10 +107,12 @@ jobs:
# already-used version number. By running `npm publish` after `git push`, # already-used version number. By running `npm publish` after `git push`,
# back-to-back merges will cause the first merge's workflow to fail but # back-to-back merges will cause the first merge's workflow to fail but
# the second's will succeed. # the second's will succeed.
- run: npm publish -
run: npm publish
env: env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Add package to etherpad organization -
name: Add package to etherpad organization
run: npm access grant read-write etherpad:developers run: npm access grant read-write etherpad:developers
env: env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}