Skip to content

Commit

Permalink
Merge 96b9a9f into 90cb180
Browse files Browse the repository at this point in the history
  • Loading branch information
moufmouf committed Jul 22, 2020
2 parents 90cb180 + 96b9a9f commit ea77250
Showing 1 changed file with 134 additions and 18 deletions.
152 changes: 134 additions & 18 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
pull_request:

jobs:
static-analysis-phpstan:
name: "Static Analysis with PHPStan"
coding-standards:
name: "Coding Standards"
runs-on: "ubuntu-latest"

strategy:
Expand All @@ -14,7 +14,7 @@ jobs:
- "7.4"

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

- name: "Install PHP"
Expand All @@ -34,28 +34,40 @@ jobs:
- name: "Install dependencies with composer"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Run a static analysis with phpstan/phpstan"
run: "composer phpstan -- --error-format=checkstyle | cs2pr"
- name: "Run PHP-CS-Fixer on src/"
run: "vendor/bin/php-cs-fixer fix src/ --dry-run --stop-on-violation --format=checkstyle | cs2pr"

coding-standards:
name: "Coding Standards"
- name: "Run PHP-CS-Fixer on tests/"
run: "vendor/bin/php-cs-fixer fix tests/ --dry-run --stop-on-violation --format=checkstyle | cs2pr"

phpunit-mysql57:
name: "PHPUnit on MySQL 5.7 and PhpStan"
runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4"

services:
mysql:
image: "mysql:5.7"
env:
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_ROOT_PASSWORD:
ports:
- "3306:3306"

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

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
tools: "cs2pr"
extensions: ""
coverage: "pcov"

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v1"
Expand All @@ -67,14 +79,18 @@ jobs:
- name: "Install dependencies with composer"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Run PHP-CS-Fixer on src/"
run: "vendor/bin/php-cs-fixer fix src/ --dry-run --stop-on-violation --report=checkstyle | cs2pr"
- name: "Run PHPUnit"
run: "vendor/bin/phpunit -c phpunit.mysql8.xml --coverage-clover=coverage.xml"

- name: "Run PHP-CS-Fixer on tests/"
run: "vendor/bin/php-cs-fixer fix tests/ --dry-run --stop-on-violation --report=checkstyle | cs2pr"
- name: "Upload Code Coverage"
uses: "codecov/codecov-action@v1"

phpunit-mysql57:
name: "PHPUnit on MySQL 5.7"
# PHPStan is run after PHPUnit because we want to analyze the generated files too.
- name: "Run a static analysis with phpstan/phpstan"
run: "composer phpstan -- --error-format=checkstyle | cs2pr"

phpunit-mysql8:
name: "PHPUnit on MySQL 8"
runs-on: "ubuntu-latest"

strategy:
Expand All @@ -84,7 +100,7 @@ jobs:

services:
mysql:
image: "mysql: 5.7"
image: "mysql:8"
env:
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_ROOT_PASSWORD:
Expand All @@ -99,7 +115,51 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
extensions: "oci8"
extensions: ""
coverage: "pcov"

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v1"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"

- name: "Install dependencies with composer"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Run PHPUnit"
run: "vendor/bin/phpunit -c phpunit.mysql8.xml --coverage-clover=coverage.xml"

- name: "Upload Code Coverage"
uses: "codecov/codecov-action@v1"

phpunit-mariadb103:
name: "PHPUnit on MariaDB 10.3"
runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4"

services:
mysql:
image: "mariadb:10.3"
env:
MYSQL_ROOT_PASSWORD: root
ports:
- "3306:3306"

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

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
extensions: ""
coverage: "pcov"

- name: "Cache dependencies installed with composer"
Expand All @@ -113,7 +173,51 @@ jobs:
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Run PHPUnit"
run: "vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover=coverage.xml"
run: "vendor/bin/phpunit -c phpunit.mariadb.xml --coverage-clover=coverage.xml"

- name: "Upload Code Coverage"
uses: "codecov/codecov-action@v1"

phpunit-mariadb105:
name: "PHPUnit on MariaDB 10.5"
runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4"

services:
mysql:
image: "mariadb:10.5"
env:
MYSQL_ROOT_PASSWORD: root
ports:
- "3306:3306"

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

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
extensions: ""
coverage: "pcov"

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v1"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"

- name: "Install dependencies with composer"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Run PHPUnit"
run: "vendor/bin/phpunit -c phpunit.mariadb.xml --coverage-clover=coverage.xml"

- name: "Upload Code Coverage"
uses: "codecov/codecov-action@v1"
Expand Down Expand Up @@ -154,6 +258,18 @@ jobs:
- name: "Install dependencies with composer"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Setup Oracle user"
run: |
docker exec -ti $(docker ps -aqf "ancestor=wnameless/oracle-xe-11g-r2") bash -c "export PS1=1 && source /etc/bash.bashrc && source /root/.bashrc && sqlplus -L -S sys/oracle AS SYSDBA <<<SQL
create user tdbm_admin identified by tdbm quota unlimited on USERS default tablespace USERS;
GRANT CONNECT,RESOURCE TO tdbm_admin;
GRANT dba TO tdbm_admin WITH ADMIN OPTION;
grant create session, create procedure, create type, create table, create sequence, create view to tdbm_admin;
grant select any dictionary to tdbm_admin;
exit
SQL"
- name: "Run PHPUnit"
run: "vendor/bin/phpunit -c phpunit.oracle.xml --coverage-clover=coverage.xml"

Expand Down

0 comments on commit ea77250

Please sign in to comment.