11# This workflow is provided via the organization template repository
22#
3- # https://github.com/nextcloud/.github
3+ # https://github.com/nextcloud-libraries /.github
44# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
55#
66# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
@@ -31,9 +31,6 @@ permissions:
3131jobs :
3232 init :
3333 runs-on : ubuntu-latest
34- outputs :
35- nodeVersion : ${{ steps.versions.outputs.nodeVersion }}
36- npmVersion : ${{ steps.versions.outputs.npmVersion }}
3734
3835 env :
3936 PUPPETEER_SKIP_DOWNLOAD : true
@@ -54,34 +51,24 @@ jobs:
5451 id : check_composer
5552 uses : andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
5653 with :
57- files : " composer.json"
54+ files : ' composer.json'
5855
5956 - name : Install composer dependencies
6057 if : steps.check_composer.outputs.files_exists == 'true'
6158 run : composer install --no-dev
6259
63- - name : Read package.json node and npm engines version
64- uses : skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
65- id : versions
66- with :
67- fallbackNode : " ^20"
68- fallbackNpm : " ^10"
69-
70- - name : Set up node ${{ steps.versions.outputs.nodeVersion }}
60+ - name : Set up node
7161 uses : actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
7262 with :
73- node-version : ${{ steps.versions.outputs.nodeVersion }}
74-
75- - name : Set up npm ${{ steps.versions.outputs.npmVersion }}
76- run : npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
63+ node-version-file : ' package.json'
7764
7865 - name : Install node dependencies & build app
7966 run : |
8067 npm ci
8168 TESTING=true npm run build --if-present
8269
8370 - name : Save context
84- uses : buildjet/cache/save@v4
71+ uses : buildjet/cache/save@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
8572 with :
8673 key : cypress-context-${{ github.run_id }}
8774 path : ./
@@ -101,22 +88,26 @@ jobs:
10188
10289 steps :
10390 - name : Restore context
104- uses : buildjet/cache/restore@v4
91+ uses : buildjet/cache/restore@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
10592 with :
10693 fail-on-cache-miss : true
10794 key : cypress-context-${{ github.run_id }}
10895 path : ./
10996
110- - name : Set up node ${{ needs.init.outputs.nodeVersion }}
97+ - name : Read package.json
98+ uses : nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0
99+ id : versions
100+
101+ - name : Set up node
111102 uses : actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
112103 with :
113- node-version : ${{ needs.init .outputs.nodeVersion }}
104+ node-version : ${{ steps.versions .outputs.node-version }}
114105
115- - name : Set up npm ${{ needs.init.outputs.npmVersion }}
116- run : npm i -g 'npm@${{ needs.init .outputs.npmVersion }}'
106+ - name : Set up npm
107+ run : npm i -g 'npm@${{ steps.versions .outputs.package-manager-version }}'
117108
118109 - name : Run ${{ startsWith(matrix.containers, 'component') && 'component' || 'E2E' }} cypress tests
119- uses : cypress-io/github-action@e65cba2e7319696fc0fdc4d5a319b737aec4ba1c # v6.10.3
110+ uses : cypress-io/github-action@7ef72e250a9e564efb4ed4c2433971ada4cc38b4 # v6.10.4
120111 with :
121112 record : ${{ secrets.CYPRESS_RECORD_KEY && true }}
122113 parallel : ${{ secrets.CYPRESS_RECORD_KEY && true }}
0 commit comments