Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 5 additions & 135 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,139 +15,9 @@ concurrency:
permissions:
contents: read

env:
COMPOSER_ROOT_VERSION: 1.x-dev
# An unreachable database fails the run instead of skipping its tests.
DB_REQUIRED: 1

jobs:
unit:
name: Unit · PHP ${{ matrix.php-version }} · ${{ matrix.dependencies }}
timeout-minutes: 6
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version:
- '8.2'
- '8.3'
- '8.4'
- '8.5'
dependencies:
- lowest
- highest
steps:
- name: 📦 Check out the codebase
uses: actions/checkout@v6
with:
persist-credentials: false

- name: 🛠️ Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: pdo, pdo_sqlite
ini-values: error_reporting=E_ALL
coverage: none

- name: 🤖 Validate composer.json
run: composer validate --ansi --strict

- name: 📥 Install dependencies with composer
uses: ramsey/composer-install@v3
with:
dependency-versions: ${{ matrix.dependencies }}

- name: 🧪 Run unit tests
run: composer test:unit

database:
name: ${{ matrix.driver }} · PHP ${{ matrix.php-version }} · ${{ matrix.dependencies }}
timeout-minutes: 12
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
driver:
- sqlite
- mysql
- postgres
- sqlserver
php-version:
- '8.2'
- '8.3'
- '8.4'
- '8.5'
dependencies:
- highest
include:
- {driver: sqlite, php-version: '8.2', dependencies: lowest}
- {driver: mysql, php-version: '8.2', dependencies: lowest}
- {driver: postgres, php-version: '8.2', dependencies: lowest}
- {driver: sqlserver, php-version: '8.2', dependencies: lowest}
steps:
- name: 📦 Check out the codebase
uses: actions/checkout@v6
with:
persist-credentials: false

- name: 🛢️ Start ${{ matrix.driver }}
if: matrix.driver != 'sqlite'
run: docker compose -f resources/docker/compose.yaml up -d --wait ${{ matrix.driver }}

- name: 🛠️ Install the Microsoft ODBC driver
if: matrix.driver == 'sqlserver'
run: |
curl -fsSL https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18

- name: 🛠️ Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: pdo, pdo_sqlite, pdo_mysql, pdo_pgsql, pdo_sqlsrv
ini-values: error_reporting=E_ALL
coverage: none

- name: 📥 Install dependencies with composer
uses: ramsey/composer-install@v3
with:
dependency-versions: ${{ matrix.dependencies }}

- name: 🧪 Run Feature, Acceptance and Regression suites
run: composer test:${{ matrix.driver }}

coverage:
name: Code coverage
timeout-minutes: 6
runs-on: ubuntu-latest
steps:
- name: 📦 Check out the codebase
uses: actions/checkout@v6
with:
persist-credentials: false

- name: 🛠️ Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: pdo, pdo_sqlite
ini-values: error_reporting=E_ALL
coverage: xdebug

- name: 📥 Install dependencies with composer
uses: ramsey/composer-install@v3
with:
dependency-versions: highest

- name: 🧪 Collect code coverage (Unit and SQLite suites)
run: composer test:cc

- name: 📤 Upload code coverage report to Codecov
uses: codecov/codecov-action@v5
continue-on-error: true
with:
files: runtime/clover.xml
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
testo:
uses: cycle/gh-actions/.github/workflows/testo.yml@master
with:
coverage: true
secrets: inherit
Loading