mirror of
https://github.com/ether/etherpad-lite.git
synced 2026-05-04 19:56:37 +02:00
PRs now run a minimal test matrix; full matrix runs on push to develop. Changes: - Backend tests: PRs test on Node 24 only (Linux). Windows tests only run on push to develop. Reduces from 12 to 2 jobs for PRs. - Upgrade-from-latest-release: PRs test on Node 24 only (1 job vs 3). - Frontend admin tests: PRs test on Node 24 only (1 job vs 3). This reduces PR CI from ~25 jobs to ~10, preventing runner exhaustion when multiple PRs are merged in succession. The full matrix (3 Node versions × Linux + Windows) still runs on every push to develop. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
107 lines
3.5 KiB
YAML
107 lines
3.5 KiB
YAML
name: "Frontend admin tests"
|
|
|
|
on:
|
|
push:
|
|
paths-ignore:
|
|
- 'doc/**'
|
|
pull_request:
|
|
paths-ignore:
|
|
- 'doc/**'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
withplugins:
|
|
env:
|
|
PNPM_HOME: ~/.pnpm-store
|
|
name: with plugins
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
# PRs: single Node version. Push: full matrix.
|
|
node: ${{ github.event_name == 'pull_request' && fromJSON('[24]') || fromJSON('[20, 22, 24]') }}
|
|
|
|
steps:
|
|
-
|
|
name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
- uses: actions/cache@v5
|
|
name: Setup gnpm cache
|
|
if: always()
|
|
with:
|
|
path: |
|
|
${{ env.PNPM_HOME }}
|
|
~/.local/share/gnpm
|
|
/usr/local/bin/gnpm
|
|
/usr/local/bin/gnpm-0.0.12
|
|
key: ${{ runner.os }}-gnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-gnpm-store-
|
|
- name: Setup gnpm
|
|
uses: SamTV12345/gnpm-setup@main
|
|
with:
|
|
version: 0.0.12
|
|
-
|
|
name: Install all dependencies and symlink for ep_etherpad-lite
|
|
run: gnpm i --runtimeVersion="${{ matrix.node }}"
|
|
- name: Cache Playwright browsers
|
|
uses: actions/cache@v5
|
|
id: playwright-cache
|
|
with:
|
|
path: ~/.cache/ms-playwright
|
|
key: ${{ runner.os }}-playwright-${{ hashFiles('src/package.json') }}
|
|
- name: Install Playwright browsers
|
|
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
|
run: cd src && npx playwright install
|
|
- name: Install Playwright system dependencies
|
|
run: cd src && npx playwright install-deps
|
|
-
|
|
name: Create settings.json
|
|
run: cp settings.json.template settings.json
|
|
-
|
|
name: Write custom settings.json that enables the Admin UI tests
|
|
run: "sed -i 's/\"enableAdminUITests\": false/\"enableAdminUITests\": true,\\n\"users\":{\"admin\":{\"password\":\"changeme1\",\"is_admin\":true}}/' settings.json"
|
|
-
|
|
name: increase maxHttpBufferSize
|
|
run: "sed -i 's/\"maxHttpBufferSize\": 50000/\"maxHttpBufferSize\": 10000000/' settings.json"
|
|
-
|
|
name: Disable import/export rate limiting
|
|
run: |
|
|
sed -e '/^ *"importExportRateLimiting":/,/^ *\}/ s/"max":.*/"max": 100000000/' -i settings.json
|
|
- name: Build admin frontend
|
|
working-directory: admin
|
|
run: |
|
|
gnpm run build --runtimeVersion="${{ matrix.node }}"
|
|
- name: Run the frontend admin tests
|
|
shell: bash
|
|
run: |
|
|
gnpm run prod --runtimeVersion="${{ matrix.node }}" > /tmp/etherpad-server.log 2>&1 &
|
|
connected=false
|
|
can_connect() {
|
|
curl -sSfo /dev/null http://localhost:9001/ || return 1
|
|
connected=true
|
|
}
|
|
now() { date +%s; }
|
|
start=$(now)
|
|
while [ $(($(now) - $start)) -le 15 ] && ! can_connect; do
|
|
sleep 1
|
|
done
|
|
cd src
|
|
gnpm run test-admin --runtimeVersion="${{ matrix.node }}"
|
|
- name: Upload server log on failure
|
|
uses: actions/upload-artifact@v7
|
|
if: failure()
|
|
with:
|
|
name: server-log-admin-${{ matrix.node }}
|
|
path: /tmp/etherpad-server.log
|
|
retention-days: 7
|
|
- uses: actions/upload-artifact@v7
|
|
if: always()
|
|
with:
|
|
name: playwright-report-${{ matrix.node }}
|
|
path: src/playwright-report/
|
|
retention-days: 30
|