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
88 changes: 88 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
#
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT

name: Playwright Tests

on:
pull_request:
branches:
- main
- stable*

permissions:
contents: read

jobs:
get-branches:
runs-on: ubuntu-latest
outputs:
branches-min: ${{ steps.versions.outputs.branches-min }}
branches-max: ${{ steps.versions.outputs.branches-max }}

steps:
- name: Checkout app
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- name: Get Nextcloud version matrix
id: versions
uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2

test:
needs: get-branches
timeout-minutes: 60
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
server-branch:
- ${{ needs.get-branches.outputs.branches-min }}
- ${{ needs.get-branches.outputs.branches-max }}

env:
NC_SERVER_BRANCH: ${{ matrix.server-branch }}

steps:
- name: Checkout app
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
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: '^20'
fallbackNpm: '^10'

- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.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 node dependencies
run: npm ci

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

- name: Run Playwright tests
run: npx playwright test

- name: Upload test results
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: always()
with:
name: playwright-report-${{ matrix.server-branch }}
path: test-results/
retention-days: 30
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build
node_modules
build
unsplash
/test-results/
/playwright-report/
7 changes: 7 additions & 0 deletions .nextcloudignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@
krankerl.toml
Makefile
screenshots
node_modules
package.json
package-lock.json
playwright
playwright.config.ts
test-results
playwright-report
Loading
Loading