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: | (github.event_name != 'pull_request') || (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id) name: with Plugins runs-on: ubuntu-latest steps: - uses: actions/setup-node@v2 with: node-version: 12 - name: Install libreoffice run: | sudo add-apt-repository -y ppa:libreoffice/ppa sudo apt update sudo apt install -y --no-install-recommends libreoffice libreoffice-pdfimport # clone etherpad-lite - name: Install etherpad core uses: actions/checkout@v2 with: repository: ether/etherpad-lite - name: Install all dependencies and symlink for ep_etherpad-lite run: src/bin/installDeps.sh - name: Checkout plugin repository uses: actions/checkout@v2 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 }} - name: Install plugin dependencies run: | cd ./node_modules/"${PLUGIN_NAME}" npm ci env: PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }} - name: Run the backend tests run: cd src && npm test