7272 server-versions : ${{ fromJson(needs.matrix.outputs.server-max) }}
7373 xdebug_mode : [debug, coverage]
7474
75- name : SQLite PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }}
75+ name : SQLite PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }} ${{ matrix.xdebug_mode }}
7676
7777 steps :
78+ - name : Abort if not PR to main with coverage
79+ if : ${{ matrix.xdebug_mode == 'coverage' && github.event.pull_request.base.ref != 'main' }}
80+ run : |
81+ echo "Coverage only runs on PRs to main"
82+ exit 0
83+
7884 - name : Set app env
7985 if : ${{ env.APP_NAME == '' }}
8086 run : |
@@ -165,6 +171,7 @@ jobs:
165171 run : composer run test:coverage
166172
167173 - name : Upload coverage results to Coveralls
174+ if : matrix.xdebug_mode == 'coverage'
168175 working-directory : apps/${{ env.APP_NAME }}
169176 env :
170177 COVERALLS_REPO_TOKEN : ${{ secrets.GITHUB_TOKEN }}
@@ -202,10 +209,6 @@ jobs:
202209 echo 'Neither PHPUnit nor PHPUnit integration tests are specified in composer.json scripts'
203210 exit 1
204211
205- - name : Set xdebug_mode output
206- id : set-xdebug-mode
207- run : echo "xdebug_mode=${{ matrix.xdebug_mode }}" >> $GITHUB_OUTPUT
208-
209212 summary :
210213 permissions :
211214 contents : none
@@ -221,7 +224,7 @@ jobs:
221224 run : if ${{ needs.changes.outputs.src != 'false' && needs.phpunit-sqlite.result != 'success' }}; then exit 1; fi
222225
223226 finish-coverage :
224- if : ${{ needs.phpunit-sqlite.outputs.xdebug_mode == 'coverage ' }}
227+ if : ${{ github.event.pull_request.base.ref == 'main ' }}
225228 needs : phpunit-sqlite
226229 runs-on : ubuntu-latest
227230 steps :
0 commit comments