-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
autofixes from Etherpad checkPlugin.js
- Loading branch information
Showing
7 changed files
with
1,280 additions
and
529 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use strict'; | ||
|
||
// This is a workaround for https://github.com/eslint/eslint/issues/3458 | ||
require('eslint-config-etherpad/patch/modern-module-resolution'); | ||
|
||
module.exports = { | ||
root: true, | ||
extends: 'etherpad/plugin', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "npm" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
versioning-strategy: "increase" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,84 +9,102 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Generate Sauce Labs strings | ||
id: sauce_strings | ||
run: | | ||
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 }}' | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 12 | ||
|
||
- name: Check out Etherpad core | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: ether/etherpad-lite | ||
|
||
- name: Check out the plugin | ||
uses: actions/checkout@v2 | ||
with: | ||
path: ./node_modules/__tmp | ||
|
||
- name: export GIT_HASH to env | ||
id: environment | ||
run: | | ||
cd ./node_modules/__tmp | ||
echo "::set-output name=sha_short::$(git rev-parse --short ${{ github.sha }})" | ||
- 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 | ||
env: | ||
PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }} | ||
run: | | ||
mv ./node_modules/__tmp ./node_modules/"${PLUGIN_NAME}" | ||
- name: Install plugin dependencies | ||
env: | ||
PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }} | ||
run: | | ||
cd ./node_modules/"${PLUGIN_NAME}" | ||
npm ci | ||
# This must be run after setting up the plugin, 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 | ||
run: src/bin/installDeps.sh | ||
|
||
- name: Create settings.json | ||
run: cp settings.json.template settings.json | ||
|
||
- name: Disable import/export rate limiting | ||
run: | | ||
sed -e '/^ *"importExportRateLimiting":/,/^ *\}/ s/"max":.*/"max": 0/' -i settings.json | ||
- name: Remove standard frontend test files | ||
run: rm -rf src/tests/frontend/specs | ||
|
||
- uses: saucelabs/sauce-connect-action@v1 | ||
with: | ||
username: ${{ secrets.SAUCE_USERNAME }} | ||
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }} | ||
tunnelIdentifier: ${{ steps.sauce_strings.outputs.tunnel_id }} | ||
|
||
- name: Run the frontend tests | ||
shell: bash | ||
env: | ||
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} | ||
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} | ||
SAUCE_NAME: ${{ steps.sauce_strings.outputs.name }} | ||
TRAVIS_JOB_NUMBER: ${{ steps.sauce_strings.outputs.tunnel_id }} | ||
GIT_HASH: ${{ steps.environment.outputs.sha_short }} | ||
run: | | ||
src/tests/frontend/travis/runner.sh | ||
- | ||
name: Fail if Dependabot | ||
if: github.actor == 'dependabot[bot]' | ||
run: | | ||
cat <<EOF >&2 | ||
Frontend tests skipped because Dependabot can't access secrets. | ||
Manually re-run the jobs to run the frontend tests. | ||
For more information, see: | ||
https://github.blog/changelog/2021-02-19-github-actions-workflows-triggered-by-dependabot-prs-will-run-with-read-only-permissions/ | ||
EOF | ||
exit 1 | ||
- | ||
name: Generate Sauce Labs strings | ||
id: sauce_strings | ||
run: | | ||
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 | ||
with: | ||
repository: ether/etherpad-lite | ||
- | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 12 | ||
cache: 'npm' | ||
cache-dependency-path: | | ||
src/package-lock.json | ||
src/bin/doc/package-lock.json | ||
- | ||
name: Check out the plugin | ||
uses: actions/checkout@v2 | ||
with: | ||
path: ./node_modules/__tmp | ||
- | ||
name: export GIT_HASH to env | ||
id: environment | ||
run: | | ||
cd ./node_modules/__tmp | ||
echo "::set-output name=sha_short::$(git rev-parse --short ${{ github.sha }})" | ||
- | ||
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 | ||
env: | ||
PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }} | ||
run: | | ||
mv ./node_modules/__tmp ./node_modules/"${PLUGIN_NAME}" | ||
- | ||
name: Install plugin dependencies | ||
env: | ||
PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }} | ||
run: | | ||
cd ./node_modules/"${PLUGIN_NAME}" | ||
npm ci | ||
# 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 | ||
run: src/bin/installDeps.sh | ||
- | ||
name: Create settings.json | ||
run: cp settings.json.template settings.json | ||
- | ||
name: Disable import/export rate limiting | ||
run: | | ||
sed -e '/^ *"importExportRateLimiting":/,/^ *\}/ s/"max":.*/"max": 0/' -i settings.json | ||
- | ||
name: Remove standard frontend test files | ||
run: rm -rf src/tests/frontend/specs | ||
- | ||
uses: saucelabs/[email protected] | ||
with: | ||
username: ${{ secrets.SAUCE_USERNAME }} | ||
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }} | ||
tunnelIdentifier: ${{ steps.sauce_strings.outputs.tunnel_id }} | ||
- | ||
name: Run the frontend tests | ||
shell: bash | ||
env: | ||
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} | ||
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} | ||
SAUCE_NAME: ${{ steps.sauce_strings.outputs.name }} | ||
TRAVIS_JOB_NUMBER: ${{ steps.sauce_strings.outputs.tunnel_id }} | ||
GIT_HASH: ${{ steps.environment.outputs.sha_short }} | ||
run: | | ||
src/tests/frontend/travis/runner.sh |
Oops, something went wrong.