Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT

name: Playwright

on:
pull_request:
push:
branches:
- main

permissions:
contents: read

concurrency:
group: playwright-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
matrix:
runs-on: ubuntu-latest-low
outputs:
server-min: ${{ steps.versions.outputs.branches-min }}
server-max: ${{ steps.versions.outputs.branches-max }}
steps:
- name: Checkout app
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Get version matrix
id: versions
uses: icewind1991/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3

playwright:
runs-on: ubuntu-latest
needs: matrix

strategy:
fail-fast: false
matrix:
# the oldest and the newest server the app supports
server-versions: ['${{ needs.matrix.outputs.server-min }}', '${{ needs.matrix.outputs.server-max }}']

name: Playwright Nextcloud ${{ matrix.server-versions }}

steps:
- name: Checkout app
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
id: versions
with:
fallbackNode: '^24'
fallbackNpm: '^11'

- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}

- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'

- name: Install dependencies and build
run: |
npm ci
npm run build --if-present

- name: Install Playwright browsers
run: npx playwright install chromium --with-deps

- name: Run Playwright tests
run: npx playwright test
env:
BRANCH: ${{ matrix.server-versions }}

- name: Show Nextcloud log on failure
if: failure()
run: docker ps -q --filter name=nextcloud-e2e-test-server | xargs -r -I{} docker exec {} cat data/nextcloud.log || true

- name: Upload Playwright report
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: playwright-report-${{ matrix.server-versions }}
path: |
playwright-report/
test-results/
retention-days: 7

summary:
permissions:
contents: none
runs-on: ubuntu-latest-low
needs: [matrix, playwright]

if: always()

name: playwright-summary

steps:
- name: Summary status
run: if ${{ needs.playwright.result != 'success' }}; then exit 1; fi
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ node_modules
/vendor/
.php-cs-fixer.cache
tests/.phpunit.cache/
/test-results/
/playwright-report/
4 changes: 4 additions & 0 deletions .nextcloudignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@
/stylelint.config.js
/webpack.*
tests
/playwright
/playwright.config.ts
/test-results
/playwright-report
Loading
Loading