build: update phpunit tests workflows

This commit is contained in:
2025-11-22 23:50:12 +02:00
parent 5b9a8e2f6f
commit d1f3c195dc
2 changed files with 36 additions and 13 deletions

View File

@@ -21,18 +21,31 @@ jobs:
matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.versions.outputs.sparse-matrix }}
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout app
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
- name: Get version matrix
- name: Get supported server versions
id: versions
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
with:
matrix: '{"mysql-versions": ["8.4"], "php-versions": ["8.1", "8.3"]}'
- name: Build test matrix
id: set-matrix
run: |
# Get server branches from version matrix
BRANCHES='${{ steps.versions.outputs.branches }}'
# Build minimal matrix: min Nextcloud with PHP 8.2, max Nextcloud with PHP 8.3
MATRIX=$(jq -nc \
--argjson branches "$BRANCHES" \
'{include: [{"php-versions": "8.2", "mysql-versions": "8.4", "server-versions": $branches[0]}, {"php-versions": "8.3", "mysql-versions": "8.4", "server-versions": $branches[-1]}]}'
)
echo "matrix=$MATRIX" >> $GITHUB_OUTPUT
echo "Generated matrix: $MATRIX"
changes:
runs-on: ubuntu-latest

View File

@@ -21,19 +21,31 @@ jobs:
matrix:
runs-on: ubuntu-latest
outputs:
php-version: ${{ steps.versions.outputs.php-available-list }}
server-max: ${{ steps.versions.outputs.branches-max-list }}
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout app
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
- name: Get version matrix
- name: Get supported server versions
id: versions
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
with:
matrix: '{"php-versions": ["8.1", "8.3"]}'
- name: Build test matrix
id: set-matrix
run: |
# Get server branches from version matrix
BRANCHES='${{ steps.versions.outputs.branches }}'
# Build minimal matrix: only latest Nextcloud with PHP 8.3
MATRIX=$(jq -nc \
--argjson branches "$BRANCHES" \
'{include: [{"php-versions": "8.3", "server-versions": $branches[-1]}]}'
)
echo "matrix=$MATRIX" >> $GITHUB_OUTPUT
echo "Generated matrix: $MATRIX"
changes:
runs-on: ubuntu-latest
@@ -69,9 +81,7 @@ jobs:
if: needs.changes.outputs.src != 'false'
strategy:
matrix:
php-versions: ${{ fromJson(needs.matrix.outputs.php-version) }}
server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }}
matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
name: PostgreSQL PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }}