@@ -23,25 +23,20 @@ jobs:
2323 name : js lint and unit tests
2424 runs-on : ubuntu-22.04
2525 steps :
26- - name : Checkout for nightly CI
27- if : github.event_name == 'schedule'
28- uses : actions/checkout@v3
26+ - name : Checkout
27+ uses : actions/checkout@v6
2928 with :
3029 ref : ${{ inputs.branch }}
3130
32- - name : Checkout
33- if : github.event_name != 'schedule'
34- uses : actions/checkout@v3
35-
3631 - name : Read package.json node and npm engines version
37- uses : skjnldsv/read-package-engines-version-actions@v2
32+ uses : skjnldsv/read-package-engines-version-actions@v3
3833 id : versions
3934 with :
40- fallbackNode : ' ^14 '
41- fallbackNpm : ' ^7 '
35+ fallbackNode : ' ^20 '
36+ fallbackNpm : ' ^10 '
4237
4338 - name : Setup NodeJS ${{ steps.versions.outputs.nodeVersion }}
44- uses : actions/setup-node@v3
39+ uses : actions/setup-node@v6
4540 with :
4641 node-version : ${{ steps.versions.outputs.nodeVersion }}
4742 cache : ' npm'
@@ -78,22 +73,17 @@ jobs:
7873 create-matrix :
7974 runs-on : ubuntu-22.04
8075 steps :
81- - name : Checkout for nightly CI
82- if : github.event_name == 'schedule'
83- uses : actions/checkout@v3
76+ - name : Checkout
77+ uses : actions/checkout@v6
8478 with :
8579 ref : ${{ inputs.branch }}
8680
87- - name : Checkout
88- if : github.event_name != 'schedule'
89- uses : actions/checkout@v3
90-
9181 - name : Create matrix
9282 id : create-matrix
9383 env :
9484 NEXTCLOUD_VERSIONS : ${{ inputs.nextcloud_versions }}
9585 PHP_VERSIONS : ${{ inputs.php_versions }}
96- DEFAULT_PHP_VERSION : " 8.2 "
86+ DEFAULT_PHP_VERSION : " 8.3 "
9787 DEFAULT_DATABASE : " mysql"
9888 EXTRA_DATABASES : " pgsql"
9989 run : |
@@ -121,11 +111,9 @@ jobs:
121111 SQL : ${{ matrix.database }}
122112 SERVER_BRANCH : ${{ matrix.nextcloudVersion }}
123113 NEXTCLOUD_AUTOINSTALL : " Yes"
124- NEXTCLOUD_AUTOINSTALL_APPS : " viewer activity groupfolders integration_openproject"
125114 NEXTCLOUD_TRUSTED_DOMAINS : nextcloud
126115 VIRTUAL_HOST : " nextcloud"
127116 WITH_REDIS : " YES"
128- NEXTCLOUD_AUTOINSTALL_APPS_WAIT_TIME : 120
129117 ports :
130118 - 80:80
131119 options : --name=nextcloud
@@ -151,57 +139,49 @@ jobs:
151139 options : --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
152140
153141 steps :
154- - name : Checkout for nightly CI
155- if : github.event_name == 'schedule'
156- uses : actions/checkout@v3
142+ - name : Checkout
143+ uses : actions/checkout@v6
157144 with :
158145 path : integration_openproject
159146 ref : ${{ inputs.branch }}
160147
161- - name : Checkout
162- if : github.event_name != 'schedule'
163- uses : actions/checkout@v3
148+ - name : Checkout server (for phpunit and psalm)
149+ uses : actions/checkout@v6
164150 with :
165- path : integration_openproject
151+ submodules : true
152+ repository : nextcloud/server
153+ path : integration_openproject/server
154+ ref : ${{ matrix.nextcloudVersion }}
166155
167- - name : Checkout activity app
168- uses : actions/checkout@v3
156+ # activity app cannot be installed using occ command
157+ - name : Checkout (activity)
158+ uses : actions/checkout@v6
169159 with :
170160 repository : nextcloud/activity
171- path : activity
172161 ref : ${{ matrix.nextcloudVersion }}
162+ path : activity
173163
174- - name : Checkout groupfolders app
175- uses : actions/checkout@v3
164+ - name : Checkout (groupfolders)
165+ uses : actions/checkout@v6
166+ if : ${{ matrix.nextcloudVersion == 'master' }}
176167 with :
177168 repository : nextcloud/groupfolders
178169 path : groupfolders
179- ref : ${{ matrix.nextcloudVersion }}
180170
181- - name : Checkout user_oidc app
182- uses : actions/checkout@v3
171+ - name : Checkout (user_oidc)
172+ uses : actions/checkout@v6
173+ if : ${{ matrix.nextcloudVersion == 'master' }}
183174 with :
184175 repository : nextcloud/user_oidc
185- ref : v7.2.0
186- fetch-tags : true
187176 path : user_oidc
188177
189- - name : Checkout oidc app
190- uses : actions/checkout@v3
178+ - name : Checkout (oidc)
179+ uses : actions/checkout@v6
180+ if : ${{ matrix.nextcloudVersion == 'master' }}
191181 with :
192182 repository : h2CK/oidc
193- ref : 1.14.1
194- fetch-tags : true
195183 path : oidc
196184
197- - name : Checkout server (for phpunit and psalm)
198- uses : actions/checkout@v3
199- with :
200- submodules : true
201- repository : nextcloud/server
202- path : integration_openproject/server
203- ref : ${{ matrix.nextcloudVersion }}
204-
205185 - name : Setup PHP ${{ format('{0}.{1}', matrix.phpVersionMajor,matrix.phpVersionMinor) }}
206186 uses : shivammathur/setup-php@v2
207187 with :
@@ -215,37 +195,45 @@ jobs:
215195 run : echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
216196
217197 - name : Cache PHP dependencies
218- uses : actions/cache@v3
198+ uses : actions/cache@v4
219199 with :
220200 path : ${{ steps.composer-cache.outputs.dir }}
221201 key : ${{ runner.os }}-composer-${{ hashFiles('./composer.lock') }}
222202 restore-keys : ${{ runner.os }}-composer-
223203
224- - name : Setup server and apps
225- run : |
226- # integration_openproject app
227- composer install --no-progress --prefer-dist --optimize-autoloader
228- # user_oidc app
229- composer install --no-interaction --prefer-dist --optimize-autoloader --working-dir=../user_oidc
230- cd server && ./occ maintenance:install --admin-pass=admin
204+ - name : Install PHP dependencies
205+ run : composer install --no-progress --prefer-dist --optimize-autoloader
206+
207+ - name : Prepare Nextcloud server (for phpunit and psalm)
208+ run : server/occ maintenance:install --admin-pass=admin
231209
232210 - name : PHP code analysis and linting
233211 run : |
234212 make psalm
235213 make phpcs || ( echo 'Please run `make phpcs-fix` to format your code' && exit 1 )
236214
237- - name : Enable apps
215+ - name : Copy dependent apps
216+ run : |
217+ composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader --working-dir=../activity
218+ cp -r ../activity server/apps
219+ if [ "${{matrix.nextcloudVersion}}" == "master" ]; then
220+ composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader --working-dir=../user_oidc
221+ composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader --working-dir=../oidc
222+ composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader --working-dir=../groupfolders
223+ cp -r ../oidc ../user_oidc ../groupfolders server/apps
224+ fi
225+
226+ - name : Enable apps (for phpunit)
238227 run : |
239228 mkdir -p server/apps/integration_openproject
240229 cp -r `ls -A | grep -v 'server'` server/apps/integration_openproject/
241- cp -r ../groupfolders ../activity server/apps
242230 cd server
243- ./occ a:e groupfolders integration_openproject activity
244- if [ "${{matrix.nextcloudVersion}}" != "stable27" ]; then
245- cp -r ../../user_oidc ../../ oidc apps
246- ./occ a:e -f user_oidc
247- # enable app even if it is not compatible with the current server version
248- ./occ a:e -f oidc
231+ if [ "${{matrix.nextcloudVersion}}" == "master" ]; then
232+ # enable app even if it is not compatible with the master branch
233+ ./occ a:e -f activity oidc user_oidc groupfolders integration_openproject
234+ else
235+ ./occ a:e activity oidc user_oidc groupfolders integration_openproject
236+ cp -r apps/ oidc apps/user_oidc apps/groupfolders ${{ github.workspace }}
249237 fi
250238
251239 - name : PHP Unit Tests
@@ -255,7 +243,7 @@ jobs:
255243
256244 - name : Setup .NET Core # this is required to execute Convert PHP cobertura coverage to lcov step
257245 if : ${{ github.event_name == 'pull_request' && matrix.nextcloudVersion == 'stable32' && matrix.phpVersion == '8.2' }}
258- uses : actions/setup-dotnet@v3
246+ uses : actions/setup-dotnet@v5
259247 with :
260248 dotnet-version : 6.0.101
261249 dotnet-quality : ' ga'
@@ -299,12 +287,16 @@ jobs:
299287 run : |
300288 # Disable share rate limit protection
301289 docker exec nextcloud /bin/bash -c 'occ config:system:set ratelimit.protection.enabled --value false --type bool'
290+ # Enable apps
291+ if [ "${{matrix.nextcloudVersion}}" == "master" ]; then
292+ # enable app even if it is not compatible with the master branch
293+ docker exec nextcloud /bin/bash -c 'occ a:e -f activity oidc user_oidc groupfolders integration_openproject'
294+ else
295+ docker exec nextcloud /bin/bash -c 'occ a:e activity oidc user_oidc groupfolders integration_openproject'
296+ fi
302297
303- - name : API Tests
304- env :
305- NEXTCLOUD_BASE_URL : http://localhost
298+ - name : Wait for Nextcloud server to be ready
306299 run : |
307- composer install --no-progress --prefer-dist --optimize-autoloader
308300 if ! timeout 5m bash -c '
309301 until curl -s -f http://localhost/status.php | grep '"'"'"installed":true'"'"'; do
310302 echo "[INFO] Waiting for server to be ready..."
@@ -314,7 +306,11 @@ jobs:
314306 echo "[ERROR] Server not ready within 5 minutes."
315307 exit 1
316308 fi
317- make api-test
309+
310+ - name : API Tests
311+ env :
312+ NEXTCLOUD_BASE_URL : http://localhost
313+ run : make api-test
318314
319315 notify-nightly-report :
320316 needs :
@@ -324,7 +320,7 @@ jobs:
324320 runs-on : ubuntu-22.04
325321 steps :
326322 - name : checkout
327- uses : actions/checkout@v2
323+ uses : actions/checkout@v6
328324
329325 - name : Notify nightly report to element
330326 env :
@@ -336,4 +332,4 @@ jobs:
336332 REPO_NAME : integration_openproject
337333 RUN_ID : ${{ github.run_id }}
338334 BRANCH_NAME : ${{ inputs.branch }}
339- run : ./.github/scripts/notify-to-element.sh
335+ run : ./.github/scripts/notify-to-element.sh
0 commit comments