name: "Backend tests" # any branch is useful for testing before a PR is submitted on: [push, pull_request] permissions: contents: read jobs: withoutpluginsLinux: # 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: Linux without plugins runs-on: ubuntu-latest strategy: fail-fast: false matrix: node: [16, 18, 20] steps: - name: Checkout repository uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} cache: 'npm' cache-dependency-path: | src/package-lock.json src/bin/doc/package-lock.json - 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 - name: Install the ep_etherpad-lite package from ./src run: src/bin/installDeps.sh - name: Run the backend tests run: cd src && npm test withpluginsLinux: # 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: Linux with Plugins runs-on: ubuntu-latest strategy: fail-fast: false matrix: node: [16, 18, 20] steps: - name: Checkout repository uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} cache: 'npm' cache-dependency-path: | src/package-lock.json src/bin/doc/package-lock.json - 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 - name: Install the ep_etherpad-lite package from ./src run: src/bin/installDeps.sh - name: Install Etherpad plugins run: > npm install ep_align ep_author_hover ep_cursortrace ep_font_size ep_hash_auth ep_headings2 ep_image_upload ep_markdown ep_readonly_guest ep_set_title_on_pad ep_spellcheck ep_subscript_and_superscript ep_table_of_contents - name: Run the backend tests run: cd src && npm test withoutpluginsWindows: # 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: Windows without plugins runs-on: windows-latest steps: - name: Checkout repository uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: node-version: 20 cache: 'npm' cache-dependency-path: | src/package-lock.json src/bin/doc/package-lock.json - name: Install the ep_etherpad-lite package from ./src run: src/bin/installOnWindows.bat - name: Run npm i once to make bin files available - why is this needed at all? run: npm i - name: Fix up the settings.json run: | 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 run test-on-windows withpluginsWindows: # 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: Windows with Plugins runs-on: windows-latest steps: - name: Checkout repository uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: node-version: 20 cache: 'npm' cache-dependency-path: | src/package-lock.json src/bin/doc/package-lock.json - name: Install the ep_etherpad-lite package from ./src run: src/bin/installOnWindows.bat - name: Run npm i once to make bin files available - why is this needed at all? run: npm i - name: Install Etherpad plugins run: > npm install ep_align ep_author_hover ep_cursortrace ep_font_size ep_hash_auth ep_headings2 ep_image_upload ep_markdown ep_readonly_guest ep_set_title_on_pad ep_spellcheck ep_subscript_and_superscript ep_table_of_contents - name: Fix up the settings.json run: | 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 run test-on-windows