1+ # This workflow is provided via the organization template repository
2+ #
3+ # https://github.com/nextcloud/.github
4+ # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+ #
6+ # SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
7+ # SPDX-License-Identifier: MIT
8+
19name : Cypress
210
311on : pull_request
1220
1321 # This represents the server branch to checkout.
1422 # Usually it's the base branch of the PR, but for pushes it's the branch itself.
15- # e.g. 'main', 'stable27' or 'feature/my-feature
23+ # e.g. 'main', 'stable27' or 'feature/my-feature'
1624 # n.b. server will use head_ref, as we want to test the PR branch.
1725 BRANCH : ${{ github.base_ref || github.ref_name }}
1826
1927jobs :
2028 init :
21- runs-on : ubuntu-latest
29+ runs-on : ubuntu-latest-low
2230 outputs :
2331 nodeVersion : ${{ steps.versions.outputs.nodeVersion }}
2432 npmVersion : ${{ steps.versions.outputs.npmVersion }}
@@ -27,12 +35,18 @@ jobs:
2735 PUPPETEER_SKIP_DOWNLOAD : true
2836
2937 steps :
38+ - name : Disabled on forks
39+ if : ${{ github.event.pull_request.head.repo.full_name != github.repository }}
40+ run : |
41+ echo 'Can not run cypress on forks'
42+ exit 1
43+
3044 - name : Checkout app
31- uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
45+ uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
3246
3347 - name : Check composer.json
3448 id : check_composer
35- uses : andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v2
49+ uses : andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
3650 with :
3751 files : " composer.json"
3852
@@ -41,19 +55,19 @@ jobs:
4155 run : composer install --no-dev
4256
4357 - name : Read package.json node and npm engines version
44- uses : skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2
58+ uses : skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
4559 id : versions
4660 with :
4761 fallbackNode : " ^20"
4862 fallbackNpm : " ^10"
4963
5064 - name : Set up node ${{ steps.versions.outputs.nodeVersion }}
51- uses : actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
65+ uses : actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
5266 with :
5367 node-version : ${{ steps.versions.outputs.nodeVersion }}
5468
5569 - name : Set up npm ${{ steps.versions.outputs.npmVersion }}
56- run : npm i -g npm@" ${{ steps.versions.outputs.npmVersion }}"
70+ run : npm i -g ' npm@${{ steps.versions.outputs.npmVersion }}'
5771
5872 - name : Install node dependencies & build app
5973 run : |
@@ -88,15 +102,15 @@ jobs:
88102 path : ./
89103
90104 - name : Set up node ${{ needs.init.outputs.nodeVersion }}
91- uses : actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
105+ uses : actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
92106 with :
93107 node-version : ${{ needs.init.outputs.nodeVersion }}
94108
95109 - name : Set up npm ${{ needs.init.outputs.npmVersion }}
96- run : npm i -g npm@" ${{ needs.init.outputs.npmVersion }}"
110+ run : npm i -g ' npm@${{ needs.init.outputs.npmVersion }}'
97111
98112 - name : Run ${{ matrix.containers == 'component' && 'component' || 'E2E' }} cypress tests
99- uses : cypress-io/github-action@1b70233146622b69e789ccdd4f9452adc638d25a # v6.6.1
113+ uses : cypress-io/github-action@496e7dc0edc421a9de8a36a31c793340e00c61bf # v6.7.5
100114 with :
101115 record : ${{ secrets.CYPRESS_RECORD_KEY && true }}
102116 parallel : ${{ secrets.CYPRESS_RECORD_KEY && true }}
@@ -119,7 +133,7 @@ jobs:
119133 CYPRESS_GROUP : Run ${{ matrix.containers == 'component' && 'component' || 'E2E' }}
120134
121135 - name : Upload snapshots
122- uses : actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
136+ uses : actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
123137 if : always()
124138 with :
125139 name : snapshots_${{ matrix.containers }}
@@ -130,14 +144,14 @@ jobs:
130144 run : docker logs nextcloud-cypress-tests-${{ env.APP_NAME }} > nextcloud.log
131145
132146 - name : Upload NC logs
133- uses : actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
147+ uses : actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
134148 if : failure() && matrix.containers != 'component'
135149 with :
136150 name : nc_logs_${{ matrix.containers }}
137151 path : nextcloud.log
138152
139153 summary :
140- runs-on : ubuntu-latest
154+ runs-on : ubuntu-latest-low
141155 needs : [init, cypress]
142156
143157 if : always()
0 commit comments