Skip to content

Commit

Permalink
Huge cleanup (PHP 8 only; prep. for long term support) (#151)
Browse files Browse the repository at this point in the history
* huge cleanup

* removed failing workflows for now

* switch to mariadb 11.0 and show db config

* mariadb 11.0 failed too; trying 10.5

* fixed bootstrap

* 2. attempt

* changed default table engine; fixed CI?

* refinements

* fixed failing tests

* removed further PDOSQLite related code

* salvaged old fixes and test

* re-added workflows; refined README

* refined adapter

* fixed get DB version code; added coding style workflow

* added DB specific adaptions

* fixed getServerVersion calls

* refined text

* reformat README

* README

* removed outdated ENV variable

* fixed coding style issue
  • Loading branch information
k00ni authored Sep 13, 2023
1 parent 586f303 commit 8ac880c
Show file tree
Hide file tree
Showing 118 changed files with 1,597 additions and 3,483 deletions.
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
name: SQLite Tests
name: "Coding Styles"

on: push
on: [push, pull_request]

jobs:
sqlite-in-memory:
name: |
SQLite Tests - PHP ${{ matrix.php }} in memory
tests:
name: Coding Styles
runs-on: ubuntu-latest

env:
DB_ADAPTER: pdo
DB_PDO_PROTOCOL: sqlite
DB_SQLITE_IN_MEMORY: true

strategy:
# if one of the matrix-entries break, all entries getting canceled.
fail-fast: true
matrix:
php:
- 7.2
- 7.3
- 7.4
- 8.0
- 8.2

steps:
- name: Checkout
Expand All @@ -33,9 +23,13 @@ jobs:
php-version: ${{ matrix.php }}
coverage: xdebug
ini-values: memory_limit=1G
tools: cs2pr

- name: Validate Composer files
run: composer validate --no-check-all --strict

- name: Install Composer dependencies
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader

- name: Tests
run: vendor/bin/phpunit
- name: Coding styles
run: php vendor/bin/php-cs-fixer fix --verbose --dry-run --format=checkstyle | cs2pr
151 changes: 0 additions & 151 deletions .github/workflows/mariadb-10.1.yml

This file was deleted.

52 changes: 52 additions & 0 deletions .github/workflows/mariadb-10.10.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: MariaDB 10.10 Tests

on: push

jobs:
pdo-mysql:
name: MariaDB 10.10 Tests - PHP ${{ matrix.php }} PDO mysql
runs-on: ubuntu-latest

env:
DB_ADAPTER: pdo
DB_PDO_PROTOCOL: mysql

strategy:
# if one of the matrix-entries break, all entries getting canceled.
fail-fast: true
matrix:
php:
- 8.0
- 8.1
- 8.2
- 8.3

services:
testdb:
image: mariadb:10.10
env:
MYSQL_ROOT_PASSWORD: Pass123
MYSQL_DATABASE: arc2_test
MYSQL_ALLOW_EMPTY_PASSWORD: false
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=15s --health-timeout=3s --health-retries=4

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: memory_limit=1G

- name: Install Composer dependencies
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader

- name: Tests
run: |
vendor/bin/phpunit
env:
DB_PORT: ${{ job.services.testdb.ports[3306] }}
52 changes: 52 additions & 0 deletions .github/workflows/mariadb-10.11.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: MariaDB 10.11 Tests

on: push

jobs:
pdo-mysql:
name: MariaDB 10.11 Tests - PHP ${{ matrix.php }} PDO mysql
runs-on: ubuntu-latest

env:
DB_ADAPTER: pdo
DB_PDO_PROTOCOL: mysql

strategy:
# if one of the matrix-entries break, all entries getting canceled.
fail-fast: true
matrix:
php:
- 8.0
- 8.1
- 8.2
- 8.3

services:
testdb:
image: mariadb:10.11
env:
MYSQL_ROOT_PASSWORD: Pass123
MYSQL_DATABASE: arc2_test
MYSQL_ALLOW_EMPTY_PASSWORD: false
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=15s --health-timeout=3s --health-retries=4

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: memory_limit=1G

- name: Install Composer dependencies
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader

- name: Tests
run: |
vendor/bin/phpunit
env:
DB_PORT: ${{ job.services.testdb.ports[3306] }}
Loading

0 comments on commit 8ac880c

Please sign in to comment.