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>
136 lines
3.9 KiB
YAML
136 lines
3.9 KiB
YAML
name: "Frontend tests"
|
|
|
|
on:
|
|
push:
|
|
paths-ignore:
|
|
- 'doc/**'
|
|
pull_request:
|
|
paths-ignore:
|
|
- 'doc/**'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
playwright-chrome:
|
|
env:
|
|
PNPM_HOME: ~/.pnpm-store
|
|
name: Playwright Chrome
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
-
|
|
name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
- uses: actions/cache@v5
|
|
name: Setup gnpm cache
|
|
if: always()
|
|
with:
|
|
path: |
|
|
${{ env.PNPM_HOME }}
|
|
~/.cache/ms-playwright
|
|
~/.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 install --frozen-lockfile
|
|
-
|
|
name: Create settings.json
|
|
run: cp ./src/tests/settings.json settings.json
|
|
- name: Run the frontend tests
|
|
shell: bash
|
|
run: |
|
|
gnpm run prod > /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 exec playwright install chromium --with-deps
|
|
gnpm run test-ui --project=chromium
|
|
- name: Upload server log on failure
|
|
uses: actions/upload-artifact@v7
|
|
if: failure()
|
|
with:
|
|
name: server-log-chrome
|
|
path: /tmp/etherpad-server.log
|
|
retention-days: 7
|
|
- uses: actions/upload-artifact@v7
|
|
if: always()
|
|
with:
|
|
name: playwright-report-chrome
|
|
path: src/playwright-report/
|
|
retention-days: 30
|
|
playwright-firefox:
|
|
env:
|
|
PNPM_HOME: ~/.pnpm-store
|
|
name: Playwright Firefox
|
|
runs-on: ubuntu-latest
|
|
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
|
|
~/.cache/ms-playwright
|
|
/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 install --frozen-lockfile
|
|
- name: Create settings.json
|
|
run: cp ./src/tests/settings.json settings.json
|
|
- name: Run the frontend tests
|
|
shell: bash
|
|
run: |
|
|
gnpm run prod > /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 exec playwright install firefox --with-deps
|
|
gnpm run test-ui --project=firefox
|
|
- name: Upload server log on failure
|
|
uses: actions/upload-artifact@v7
|
|
if: failure()
|
|
with:
|
|
name: server-log-firefox
|
|
path: /tmp/etherpad-server.log
|
|
retention-days: 7
|
|
- uses: actions/upload-artifact@v7
|
|
if: always()
|
|
with:
|
|
name: playwright-report-firefox
|
|
path: src/playwright-report/
|
|
retention-days: 30
|