1818 # Adjust APP_NAME if your repository name is different
1919 APP_NAME : ${{ github.event.repository.name }}
2020
21- # Server requires head_ref instead of base_ref, as we want to test the PR branch
21+ # This represents the server branch to checkout.
22+ # Usually it's the base branch of the PR, but for pushes it's the branch itself.
23+ # e.g. 'main', 'stable27' or 'feature/my-feature'
24+ # n.b. server will use head_ref, as we want to test the PR branch.
2225 BRANCH : ${{ github.head_ref || github.ref_name }}
2326
27+
28+ permissions :
29+ contents : read
30+
2431jobs :
2532 init :
2633 runs-on : ubuntu-latest
3946 exit 1
4047
4148 - name : Checkout server
42- uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
49+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4350 with :
51+ persist-credentials : false
4452 # We need to checkout submodules for 3rdparty
4553 submodules : true
4654
6270 fallbackNpm : " ^10"
6371
6472 - name : Set up node ${{ steps.versions.outputs.nodeVersion }}
65- uses : actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
73+ uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
6674 with :
6775 node-version : ${{ steps.versions.outputs.nodeVersion }}
6876
7886 run : npm run cypress:version
7987
8088 - name : Save context
81- uses : buildjet/cache/save@e376f15c6ec6dc595375c78633174c7e5f92dc0e # v3
89+ uses : buildjet/cache/save@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
8290 with :
8391 key : cypress-context-${{ github.run_id }}
8492 path : ./
92100 matrix :
93101 # Run multiple copies of the current job in parallel
94102 # Please increase the number or runners as your tests suite grows (0 based index for e2e tests)
95- containers : [" component" , '0', '1', '2', '3', '4', '5', '6', '7']
103+ containers : [' component' , '0', '1', '2', '3', '4', '5', '6', '7']
96104 # Hack as strategy.job-total includes the component and GitHub does not allow math expressions
97105 # Always align this number with the total of e2e runners (max. index + 1)
98106 total-containers : [8]
@@ -101,22 +109,22 @@ jobs:
101109
102110 steps :
103111 - name : Restore context
104- uses : buildjet/cache/restore@e376f15c6ec6dc595375c78633174c7e5f92dc0e # v3
112+ uses : buildjet/cache/restore@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
105113 with :
106114 fail-on-cache-miss : true
107115 key : cypress-context-${{ github.run_id }}
108116 path : ./
109117
110118 - name : Set up node ${{ needs.init.outputs.nodeVersion }}
111- uses : actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
119+ uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
112120 with :
113121 node-version : ${{ needs.init.outputs.nodeVersion }}
114122
115123 - name : Set up npm ${{ needs.init.outputs.npmVersion }}
116124 run : npm i -g 'npm@${{ needs.init.outputs.npmVersion }}'
117125
118126 - name : Run ${{ matrix.containers == 'component' && 'component' || 'E2E' }} cypress tests
119- uses : cypress-io/github-action@df7484c5ba85def7eef30db301afa688187bc378 # v6.7.2
127+ uses : cypress-io/github-action@f1f0912d392f0d06bdd01fb9ebe3b3299e5806fb # v6.7.7
120128 with :
121129 component : ${{ matrix.containers == 'component' }}
122130 group : ${{ matrix.use-cypress-cloud && matrix.containers == 'component' && 'Run component' || matrix.use-cypress-cloud && 'Run E2E' || '' }}
@@ -135,8 +143,8 @@ jobs:
135143 SPLIT : ${{ matrix.total-containers }}
136144 SPLIT_INDEX : ${{ matrix.containers == 'component' && 0 || matrix.containers }}
137145
138- - name : Upload snapshots
139- uses : actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
146+ - name : Upload snapshots and videos
147+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
140148 if : always()
141149 with :
142150 name : snapshots_videos_${{ matrix.containers }}
@@ -149,7 +157,7 @@ jobs:
149157 run : docker logs nextcloud-cypress-tests_${{ env.APP_NAME }} > nextcloud.log
150158
151159 - name : Upload NC logs
152- uses : actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
160+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
153161 if : failure() && matrix.containers != 'component'
154162 with :
155163 name : nc_logs_${{ matrix.containers }}
@@ -160,7 +168,7 @@ jobs:
160168 run : docker exec nextcloud-cypress-tests_${{ env.APP_NAME }} tar -cvjf - data > data.tar
161169
162170 - name : Upload data dir archive
163- uses : actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
171+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
164172 if : failure() && matrix.containers != 'component'
165173 with :
166174 name : nc_data_${{ matrix.containers }}
0 commit comments