summaryrefslogtreecommitdiffstats
path: root/.github/workflows/phpunit-pgsql.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/phpunit-pgsql.yml')
-rw-r--r--.github/workflows/phpunit-pgsql.yml84
1 files changed, 54 insertions, 30 deletions
diff --git a/.github/workflows/phpunit-pgsql.yml b/.github/workflows/phpunit-pgsql.yml
index 5e66fd2c..a9991165 100644
--- a/.github/workflows/phpunit-pgsql.yml
+++ b/.github/workflows/phpunit-pgsql.yml
@@ -3,27 +3,9 @@
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
-name: PHPUnit pgsql
-
-on:
- pull_request:
- paths:
- - '.github/workflows/**'
- - 'appinfo/**'
- - 'lib/**'
- - 'templates/**'
- - 'tests/**'
- - 'vendor/**'
- - 'vendor-bin/**'
- - '.php-cs-fixer.dist.php'
- - 'composer.json'
- - 'composer.lock'
-
- push:
- branches:
- - main
- - master
- - stable*
+name: PHPUnit PostgreSQL
+
+on: pull_request
permissions:
contents: read
@@ -33,13 +15,55 @@ concurrency:
cancel-in-progress: true
jobs:
+ matrix:
+ runs-on: ubuntu-latest-low
+ outputs:
+ php-version: ${{ steps.versions.outputs.php-available-list }}
+ server-max: ${{ steps.versions.outputs.branches-max-list }}
+ steps:
+ - name: Checkout app
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
+
+ - name: Get version matrix
+ id: versions
+ uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
+
+ changes:
+ runs-on: ubuntu-latest-low
+
+ outputs:
+ src: ${{ steps.changes.outputs.src}}
+
+ steps:
+ - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
+ id: changes
+ continue-on-error: true
+ with:
+ filters: |
+ src:
+ - '.github/workflows/**'
+ - 'appinfo/**'
+ - 'lib/**'
+ - 'templates/**'
+ - 'tests/**'
+ - 'vendor/**'
+ - 'vendor-bin/**'
+ - '.php-cs-fixer.dist.php'
+ - 'composer.json'
+ - 'composer.lock'
+
phpunit-pgsql:
runs-on: ubuntu-latest
+ needs: [changes, matrix]
+ if: needs.changes.outputs.src != 'false'
+
strategy:
matrix:
- php-versions: ['8.0']
- server-versions: ['master']
+ php-versions: ${{ fromJson(needs.matrix.outputs.php-version) }}
+ server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }}
+
+ name: PostgreSQL PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }}
services:
postgres:
@@ -59,19 +83,19 @@ jobs:
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
- name: Checkout server
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: true
repository: nextcloud/server
ref: ${{ matrix.server-versions }}
- name: Checkout app
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
path: apps/${{ env.APP_NAME }}
- name: Set up php ${{ matrix.php-versions }}
- uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2
+ uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d # v2
with:
php-version: ${{ matrix.php-versions }}
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
@@ -83,7 +107,7 @@ jobs:
- name: Check composer file existence
id: check_composer
- uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2
+ uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v2
with:
files: apps/${{ env.APP_NAME }}/composer.json
@@ -147,8 +171,8 @@ jobs:
summary:
permissions:
contents: none
- runs-on: ubuntu-latest
- needs: phpunit-pgsql
+ runs-on: ubuntu-latest-low
+ needs: [changes, phpunit-pgsql]
if: always()
@@ -156,4 +180,4 @@ jobs:
steps:
- name: Summary status
- run: if ${{ needs.phpunit-pgsql.result != 'success' }}; then exit 1; fi
+ run: if ${{ needs.changes.outputs.src != 'false' && needs.phpunit-pgsql.result != 'success' }}; then exit 1; fi