18
18
19
19
jobs :
20
20
init :
21
- runs-on : ubuntu-latest
21
+ runs-on : ubuntu-22.04
22
+ outputs :
23
+ nodeVersion : ${{ steps.versions.outputs.nodeVersion }}
24
+ npmVersion : ${{ steps.versions.outputs.npmVersion }}
22
25
23
26
steps :
24
-
25
27
- name : Checkout server
26
- uses : actions/checkout@v3
28
+ uses : actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
27
29
with :
28
30
repository : nextcloud/server
29
31
ref : ${{ matrix.server-versions }}
30
-
31
- - name : Checkout submodules
32
- shell : bash
33
- run : |
34
- auth_header="$(git config --local --get http.https://github.com/.extraheader)"
35
- git submodule sync --recursive
36
- git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
32
+ submodules : true
37
33
38
34
- name : Checkout viewer
39
- uses : actions/checkout@v3
35
+ uses : actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
40
36
with :
41
37
repository : nextcloud/viewer
42
38
ref : ${{ matrix.server-versions }}
43
39
path : apps/viewer
44
40
45
41
- name : Checkout app
46
- uses : actions/checkout@v3
42
+ uses : actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
47
43
with :
48
44
path : apps/${{ env.APP_NAME }}
49
45
50
- - name : Set up node 16
51
- uses : actions/setup-node@v3
46
+ - name : Read package.json node and npm engines version
47
+ uses : skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1
48
+ id : versions
49
+ with :
50
+ fallbackNode : " ^14"
51
+ fallbackNpm : " ^7"
52
+
53
+ - name : Set up node ${{ steps.versions.outputs.nodeVersion }}
54
+ uses : actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
52
55
with :
53
56
cache : ' npm'
54
- cache-dependency-path : apps/${{ env.APP_NAME}}/package-lock.json
55
- node-version : 16
57
+ node-version : ${{ steps.versions.outputs.nodeVersion }}
56
58
57
- - name : Install dependencies & build app
58
- working-directory : apps/${{ env.APP_NAME }}
59
- run : |
60
- npm ci
61
- TESTING=true npm run build --if-present
59
+ - name : Set up npm ${{ steps.versions.outputs.npmVersion }}
60
+ run : npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
62
61
63
62
- name : Save context
64
- uses : actions/cache@v3
63
+ uses : actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
65
64
with :
66
65
key : cypress-context-${{ github.run_id }}
67
- path : /home/runner/work
66
+ path : ./
68
67
69
68
cypress :
70
- runs-on : ubuntu-latest
69
+ runs-on : ubuntu-22.04
71
70
needs : init
72
71
73
72
strategy :
@@ -77,19 +76,26 @@ jobs:
77
76
containers : [1, 2, 3, 4, 5, 6, 7, 8]
78
77
php-versions : [ '8.1' ]
79
78
databases : [ 'sqlite' ]
80
- server-versions : [ 'stable26' ]
79
+ server-versions : ['stable26']
81
80
82
- steps :
83
- - name : Use Node.js ${{ matrix.node-version }}
84
- uses : actions/setup-node@v3
85
- with :
86
- node-version : ${{ matrix.node-version }}
81
+ name : runner ${{ matrix.containers }}
87
82
83
+ steps :
88
84
- name : Restore context
89
- uses : actions/cache@v3
85
+ uses : actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
90
86
with :
87
+ fail-on-cache-miss : true
91
88
key : cypress-context-${{ github.run_id }}
92
- path : /home/runner/work
89
+ path : ./
90
+
91
+ - name : Set up node ${{ needs.init.outputs.nodeVersion }}
92
+ uses : actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
93
+ with :
94
+ cache : ' npm'
95
+ node-version : ${{ needs.init.outputs.nodeVersion }}
96
+
97
+ - name : Set up npm ${{ needs.init.outputs.npmVersion }}
98
+ run : npm i -g npm@"${{ needs.init.outputs.npmVersion }}"
93
99
94
100
- name : Set up php ${{ matrix.php-versions }}
95
101
uses : shivammathur/setup-php@v2
@@ -150,3 +156,15 @@ jobs:
150
156
name : Upload nextcloud log
151
157
path : data/nextcloud.log
152
158
retention-days : 5
159
+
160
+ summary :
161
+ runs-on : ubuntu-latest
162
+ needs : [init, cypress]
163
+
164
+ if : always()
165
+
166
+ name : cypress-summary
167
+
168
+ steps :
169
+ - name : Summary status
170
+ run : if ${{ needs.init.result != 'success' || ( needs.cypress.result != 'success' && needs.cypress.result != 'skipped' ) }}; then exit 1; fi
0 commit comments