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
2810permissions :
2911 contents : read
@@ -33,17 +15,47 @@ concurrency:
3315 cancel-in-progress : true
3416
3517jobs :
18+ changes :
19+ runs-on : ubuntu-latest
20+
21+ outputs :
22+ src : ${{ steps.changes.outputs.src}}
23+
24+ steps :
25+ - uses : dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
26+ id : changes
27+ continue-on-error : true
28+ with :
29+ filters : |
30+ src:
31+ - '.github/workflows/**'
32+ - 'appinfo/**'
33+ - 'lib/**'
34+ - 'templates/**'
35+ - 'tests/**'
36+ - 'vendor/**'
37+ - 'vendor-bin/**'
38+ - '.php-cs-fixer.dist.php'
39+ - 'composer.json'
40+ - 'composer.lock'
41+
3642 phpunit-mysql :
3743 runs-on : ubuntu-latest
3844
45+ needs : changes
46+ if : needs.changes.outputs.src != 'false'
47+
3948 strategy :
4049 matrix :
4150 php-versions : ['8.0', '8.1', '8.2', '8.3']
4251 server-versions : ['master']
52+ mysql-versions : ['8.1']
53+
54+ name : MySQL ${{ matrix.mysql-versions }} PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }}
4355
4456 services :
4557 mysql :
46- image : ghcr.io/nextcloud/continuous-integration-mariadb-10.6 :latest
58+ image : ghcr.io/nextcloud/continuous-integration-mysql-${{ matrix.mysql-versions }} :latest
4759 ports :
4860 - 4444:3306/tcp
4961 env :
@@ -57,19 +69,19 @@ jobs:
5769 echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
5870
5971 - name : Checkout server
60- uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
72+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
6173 with :
6274 submodules : true
6375 repository : nextcloud/server
6476 ref : ${{ matrix.server-versions }}
6577
6678 - name : Checkout app
67- uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
79+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
6880 with :
6981 path : apps/${{ env.APP_NAME }}
7082
7183 - name : Set up php ${{ matrix.php-versions }}
72- uses : shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
84+ uses : shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # v2
7385 with :
7486 php-version : ${{ matrix.php-versions }}
7587 # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
@@ -151,12 +163,12 @@ jobs:
151163 permissions :
152164 contents : none
153165 runs-on : ubuntu-latest
154- needs : phpunit-mysql
166+ needs : [changes, phpunit-mysql]
155167
156168 if : always()
157169
158170 name : phpunit-mysql-summary
159171
160172 steps :
161173 - name : Summary status
162- run : if ${{ needs.phpunit-mysql.result != 'success' }}; then exit 1; fi
174+ run : if ${{ needs.changes.outputs.src != 'false' && needs. phpunit-mysql.result != 'success' }}; then exit 1; fi
0 commit comments