Skip to content

Commit

Permalink
automatically determine php/server versions for phpunit
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <robin@icewind.nl>
  • Loading branch information
icewind1991 committed Nov 3, 2023
1 parent 8d561ab commit 1bb2769
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 15 deletions.
18 changes: 15 additions & 3 deletions workflow-templates/phpunit-mariadb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ concurrency:
cancel-in-progress: true

jobs:
matrix:
runs-on: ubuntu-latest
outputs:
php-max: ${{ steps.versions.outputs.php-max-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@c2bf575a3516752db5ce2915499d3f694885e2c7 # v1.0.0

changes:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -42,14 +54,14 @@ jobs:
phpunit-mariadb:
runs-on: ubuntu-latest

needs: changes
needs: [changes, matrix]
if: needs.changes.outputs.src != 'false'

strategy:
matrix:
php-versions: ['8.2']
php-versions: ${{ fromJson(needs.matrix.outputs.php-max) }}
server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }}
mariadb-versions: ['10.6', '10.11']
server-versions: ['master']

name: MariaDB ${{ matrix.mariadb-versions }} PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }}

Expand Down
18 changes: 15 additions & 3 deletions workflow-templates/phpunit-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ concurrency:
cancel-in-progress: true

jobs:
matrix:
runs-on: ubuntu-latest
outputs:
php-versions: ${{ steps.versions.outputs.php-versions }}
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@c2bf575a3516752db5ce2915499d3f694885e2c7 # v1.0.0

changes:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -42,13 +54,13 @@ jobs:
phpunit-mysql:
runs-on: ubuntu-latest

needs: changes
needs: [changes, matrix]
if: needs.changes.outputs.src != 'false'

strategy:
matrix:
php-versions: ['8.0', '8.1', '8.2', '8.3']
server-versions: ['master']
php-versions: ${{fromJson(needs.matrix.outputs.php-versions)}}
server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }}
mysql-versions: ['8.1']

name: MySQL ${{ matrix.mysql-versions }} PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }}
Expand Down
18 changes: 15 additions & 3 deletions workflow-templates/phpunit-oci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ concurrency:
cancel-in-progress: true

jobs:
matrix:
runs-on: ubuntu-latest
outputs:
php-max: ${{ steps.versions.outputs.php-max-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@c2bf575a3516752db5ce2915499d3f694885e2c7 # v1.0.0

changes:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -42,13 +54,13 @@ jobs:
phpunit-oci:
runs-on: ubuntu-22.04

needs: changes
needs: [changes, matrix]
if: needs.changes.outputs.src != 'false'

strategy:
matrix:
php-versions: ['8.2']
server-versions: ['master']
php-versions: ${{ fromJson(needs.matrix.outputs.php-max) }}
server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }}

services:
oracle:
Expand Down
18 changes: 15 additions & 3 deletions workflow-templates/phpunit-pgsql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ concurrency:
cancel-in-progress: true

jobs:
matrix:
runs-on: ubuntu-latest
outputs:
php-max: ${{ steps.versions.outputs.php-max-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@c2bf575a3516752db5ce2915499d3f694885e2c7 # v1.0.0

changes:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -42,13 +54,13 @@ jobs:
phpunit-pgsql:
runs-on: ubuntu-latest

needs: changes
needs: [changes, matrix]
if: needs.changes.outputs.src != 'false'

strategy:
matrix:
php-versions: ['8.2']
server-versions: ['master']
php-versions: ${{ fromJson(needs.matrix.outputs.php-max) }}
server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }}

services:
postgres:
Expand Down
18 changes: 15 additions & 3 deletions workflow-templates/phpunit-sqlite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ concurrency:
cancel-in-progress: true

jobs:
matrix:
runs-on: ubuntu-latest
outputs:
php-max: ${{ steps.versions.outputs.php-max-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@c2bf575a3516752db5ce2915499d3f694885e2c7 # v1.0.0

changes:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -42,13 +54,13 @@ jobs:
phpunit-sqlite:
runs-on: ubuntu-latest

needs: changes
needs: [changes, matrix]
if: needs.changes.outputs.src != 'false'

strategy:
matrix:
php-versions: ['8.2']
server-versions: ['master']
php-versions: ${{ fromJson(needs.matrix.outputs.php-max) }}
server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }}

steps:
- name: Set app env
Expand Down

0 comments on commit 1bb2769

Please sign in to comment.