Skip to content

Commit b38aa74

Browse files
committed
feat: Add Cypress component tests workflow
Signed-off-by: Enjeck C. <[email protected]>
1 parent a180626 commit b38aa74

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
2+
# SPDX-License-Identifier: MIT
3+
4+
name: Cypress Component Tests
5+
6+
on:
7+
pull_request:
8+
push:
9+
branches:
10+
- main
11+
- master
12+
- stable*
13+
14+
concurrency:
15+
group: cypress-component-${{ github.head_ref || github.run_id }}
16+
cancel-in-progress: true
17+
18+
env:
19+
APP_NAME: tables
20+
21+
jobs:
22+
component-tests:
23+
runs-on: ubuntu-latest
24+
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
node-version: [20]
29+
30+
steps:
31+
- name: Checkout app
32+
uses: actions/checkout@v4
33+
34+
- name: Set up Node.js ${{ matrix.node-version }}
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: ${{ matrix.node-version }}
38+
cache: 'npm'
39+
cache-dependency-path: package-lock.json
40+
41+
- name: Install dependencies
42+
run: npm ci
43+
44+
- name: Build app
45+
run: npm run build --if-present
46+
47+
- name: Run component tests
48+
run: npm run tests:component
49+
50+
- name: Upload test failure screenshots
51+
uses: actions/upload-artifact@v4
52+
if: failure()
53+
with:
54+
name: cypress-component-screenshots-node${{ matrix.node-version }}
55+
path: cypress/screenshots/
56+
retention-days: 5
57+
58+
- name: Upload test videos
59+
uses: actions/upload-artifact@v4
60+
if: failure()
61+
with:
62+
name: cypress-component-videos-node${{ matrix.node-version }}
63+
path: cypress/videos/
64+
retention-days: 5
65+
66+
summary:
67+
permissions:
68+
contents: none
69+
runs-on: ubuntu-latest-low
70+
needs: component-tests
71+
72+
if: always()
73+
74+
name: cypress-component-summary
75+
76+
steps:
77+
- name: Summary status
78+
run: if ${{ needs.component-tests.result != 'success' && needs.component-tests.result != 'skipped' }}; then exit 1; fi

0 commit comments

Comments
 (0)