checkPlugin: Automatically determine plugin name in `backend-tests.yml`

pull/5323/head
Richard Hansen 2021-06-14 19:36:20 -04:00
parent 314b67b7fe
commit f0669a8d31
1 changed files with 22 additions and 8 deletions

View File

@ -1,6 +1,3 @@
# You need to change lines 38 and 46 in case the plugin's name on npmjs.com is different
# from the repository name
name: "Backend tests" name: "Backend tests"
# any branch is useful for testing before a PR is submitted # any branch is useful for testing before a PR is submitted
@ -17,6 +14,10 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/setup-node@v2
with:
node-version: 12
- name: Install libreoffice - name: Install libreoffice
run: | run: |
sudo add-apt-repository -y ppa:libreoffice/ppa sudo add-apt-repository -y ppa:libreoffice/ppa
@ -32,19 +33,32 @@ jobs:
- name: Install all dependencies and symlink for ep_etherpad-lite - name: Install all dependencies and symlink for ep_etherpad-lite
run: src/bin/installDeps.sh run: src/bin/installDeps.sh
# clone this repository into node_modules/ep_plugin-name
- name: Checkout plugin repository - name: Checkout plugin repository
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
path: ./node_modules/${{github.event.repository.name}} 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 }}
- name: Install plugin dependencies - name: Install plugin dependencies
run: | run: |
cd node_modules/${{github.event.repository.name}} cd ./node_modules/"${PLUGIN_NAME}"
npm ci npm ci
env:
PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }}
- name: Run the backend tests - name: Run the backend tests
run: cd src && npm test run: cd src && npm test
##ETHERPAD_NPM_V=2 # Automatically generated by src/bin/plugins/checkPlugin.js
## NPM configuration automatically created using src/bin/plugins/updateAllPluginsScript.sh ##ETHERPAD_NPM_V=3