Skip to content
Open
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
103 changes: 103 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT

name: Playwright

on: pull_request

permissions:
contents: read

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

jobs:
changes:
runs-on: ubuntu-latest-low
permissions:
contents: read
pull-requests: read

outputs:
src: ${{ steps.changes.outputs.src }}

steps:
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
with:
filters: |
src:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This summarizes to "always".

- '.github/workflows/**'
- 'appinfo/**'
- 'js/**'
- 'lib/**'
- 'playwright/**'
- 'src/**'
- 'templates/**'
- 'package.json'
- 'package-lock.json'
- 'playwright.config.ts'

e2e:
runs-on: ubuntu-latest

needs: changes
if: needs.changes.outputs.src != 'false'

name: Playwright e2e tests

steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.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.3'

- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.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
run: npm ci

- name: Install Playwright browser
run: npx playwright install chromium --only-shell

- name: Run Playwright tests
run: npx playwright test
env:
CI: true

- name: Upload Playwright report
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30

summary:
permissions:
contents: none
runs-on: ubuntu-latest-low
needs: [changes, e2e]

if: always()

# This is the summary, we just avoid to rename it so that branch protection rules still match
name: playwright

steps:
- name: Summary status
run: if ${{ needs.changes.outputs.src != 'false' && needs.e2e.result != 'success' }}; then exit 1; fi
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,9 @@ node_modules
**/vendor/
/build
composer.phar

# Playwright
/playwright-report/
/blob-report/
/playwright/.cache/
/test-results/
Loading