Skip to content

Commit 02b5741

Browse files
authored
Merge pull request #2821 from nextcloud/fix/update-nextcloud-ocp-stable27
2 parents 7b20848 + e36d577 commit 02b5741

File tree

3 files changed

+105
-81
lines changed

3 files changed

+105
-81
lines changed

.github/workflows/phpunit-mysql.yml

+60-37
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,9 @@
33
# https://github.com/nextcloud/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
55

6-
name: PHPUnit mysql
7-
8-
on:
9-
pull_request:
10-
paths:
11-
- '.github/workflows/**'
12-
- 'appinfo/**'
13-
- 'lib/**'
14-
- 'templates/**'
15-
- 'tests/**'
16-
- 'vendor/**'
17-
- 'vendor-bin/**'
18-
- '.php-cs-fixer.dist.php'
19-
- 'composer.json'
20-
- 'composer.lock'
21-
22-
push:
23-
branches:
24-
- main
25-
- master
26-
- stable*
6+
name: PHPUnit MySQL
7+
8+
on: pull_request
279

2810
permissions:
2911
contents: read
@@ -33,17 +15,58 @@ concurrency:
3315
cancel-in-progress: true
3416

3517
jobs:
18+
matrix:
19+
runs-on: ubuntu-latest-low
20+
outputs:
21+
matrix: ${{ steps.versions.outputs.sparse-matrix }}
22+
steps:
23+
- name: Checkout app
24+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
25+
26+
- name: Get version matrix
27+
id: versions
28+
uses: icewind1991/nextcloud-version-matrix@7d433286e92318f51ed0537b6c77374759e12f46 # v1.3.0
29+
with:
30+
matrix: '{"mysql-versions": ["8.1"]}'
31+
32+
changes:
33+
runs-on: ubuntu-latest-low
34+
35+
outputs:
36+
src: ${{ steps.changes.outputs.src}}
37+
38+
steps:
39+
- uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0
40+
id: changes
41+
continue-on-error: true
42+
with:
43+
filters: |
44+
src:
45+
- '.github/workflows/**'
46+
- 'appinfo/**'
47+
- 'lib/**'
48+
- 'templates/**'
49+
- 'tests/**'
50+
- 'vendor/**'
51+
- 'vendor-bin/**'
52+
- '.php-cs-fixer.dist.php'
53+
- 'composer.json'
54+
- 'composer.lock'
55+
3656
phpunit-mysql:
3757
runs-on: ubuntu-latest
3858

59+
needs: [changes, matrix]
60+
if: needs.changes.outputs.src != 'false'
61+
3962
strategy:
40-
matrix:
41-
php-versions: ['8.0', '8.1', '8.2']
42-
server-versions: ['stable27']
63+
matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
64+
65+
name: MySQL ${{ matrix.mysql-versions }} PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }}
4366

4467
services:
4568
mysql:
46-
image: ghcr.io/nextcloud/continuous-integration-mariadb-10.6:latest
69+
image: ghcr.io/nextcloud/continuous-integration-mysql-${{ matrix.mysql-versions }}:latest
4770
ports:
4871
- 4444:3306/tcp
4972
env:
@@ -56,25 +79,20 @@ jobs:
5679
# Split and keep last
5780
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
5881
59-
- name: Enable ONLY_FULL_GROUP_BY MySQL option
60-
run: |
61-
echo "SET GLOBAL sql_mode=(SELECT CONCAT(@@sql_mode,',ONLY_FULL_GROUP_BY'));" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword
62-
echo "SELECT @@sql_mode;" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword
63-
6482
- name: Checkout server
65-
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
83+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
6684
with:
6785
submodules: true
6886
repository: nextcloud/server
6987
ref: ${{ matrix.server-versions }}
7088

7189
- name: Checkout app
72-
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
90+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
7391
with:
7492
path: apps/${{ env.APP_NAME }}
7593

7694
- name: Set up php ${{ matrix.php-versions }}
77-
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2
95+
uses: shivammathur/setup-php@6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d # v2
7896
with:
7997
php-version: ${{ matrix.php-versions }}
8098
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
@@ -84,9 +102,14 @@ jobs:
84102
env:
85103
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86104

105+
- name: Enable ONLY_FULL_GROUP_BY MySQL option
106+
run: |
107+
echo "SET GLOBAL sql_mode=(SELECT CONCAT(@@sql_mode,',ONLY_FULL_GROUP_BY'));" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword
108+
echo "SELECT @@sql_mode;" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword
109+
87110
- name: Check composer file existence
88111
id: check_composer
89-
uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2
112+
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v2
90113
with:
91114
files: apps/${{ env.APP_NAME }}/composer.json
92115

@@ -150,13 +173,13 @@ jobs:
150173
summary:
151174
permissions:
152175
contents: none
153-
runs-on: ubuntu-latest
154-
needs: phpunit-mysql
176+
runs-on: ubuntu-latest-low
177+
needs: [changes, phpunit-mysql]
155178

156179
if: always()
157180

158181
name: phpunit-mysql-summary
159182

160183
steps:
161184
- name: Summary status
162-
run: if ${{ needs.phpunit-mysql.result != 'success' }}; then exit 1; fi
185+
run: if ${{ needs.changes.outputs.src != 'false' && needs.phpunit-mysql.result != 'success' }}; then exit 1; fi

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"phpunit/phpunit": "^9",
44
"sabre/dav": "^4.1",
55
"sabre/xml": "^2.2",
6-
"symfony/event-dispatcher": "^5.3.11",
6+
"symfony/event-dispatcher": "^5.4.35",
77
"psalm/phar": "^4.10",
88
"nextcloud/coding-standard": "^1.0",
99
"nextcloud/ocp": "dev-stable27"
@@ -26,7 +26,7 @@
2626
"composer/package-versions-deprecated": true
2727
},
2828
"platform": {
29-
"php": "8.0"
29+
"php": "8.0.2"
3030
}
3131
},
3232
"autoload-dev": {

0 commit comments

Comments
 (0)