Skip to content

Commit

Permalink
Merge 2de35bf into 90cb180
Browse files Browse the repository at this point in the history
  • Loading branch information
moufmouf committed Jul 22, 2020
2 parents 90cb180 + 2de35bf commit 06ea34c
Showing 1 changed file with 140 additions and 24 deletions.
164 changes: 140 additions & 24 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,27 +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 }}"
extensions: ""
coverage: "pcov"
tools: "cs2pr"

- name: "Cache dependencies installed with composer"
Expand All @@ -67,14 +80,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 +101,7 @@ jobs:

services:
mysql:
image: "mysql: 5.7"
image: "mysql:8"
env:
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_ROOT_PASSWORD:
Expand All @@ -99,7 +116,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-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"
Expand All @@ -113,13 +174,13 @@ 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-oci8:
name: "PHPUnit on OCI8"
phpunit-postgresql:
name: "PHPUnit on PostgreSQL"
runs-on: "ubuntu-latest"

strategy:
Expand All @@ -128,10 +189,12 @@ jobs:
- "7.4"

services:
oracle:
image: "wnameless/oracle-xe-11g-r2"
postgres:
image: "postgres:9.6"
env:
POSTGRES_PASSWORD:
ports:
- "1521:1521"
- "5432:5432"

steps:
- name: "Checkout"
Expand All @@ -141,7 +204,7 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
extensions: "oci8"
extensions: ""
coverage: "pcov"

- name: "Cache dependencies installed with composer"
Expand All @@ -155,7 +218,60 @@ jobs:
run: "composer install --no-interaction --no-progress --no-suggest"

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

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

# phpunit-oci8:
# name: "PHPUnit on OCI8"
# runs-on: "ubuntu-latest"
#
# strategy:
# matrix:
# php-version:
# - "7.4"
#
# services:
# oracle:
# image: "wnameless/oracle-xe-11g-r2"
# ports:
# - "1521:1521"
#
# steps:
# - name: "Checkout"
# uses: "actions/checkout@v2"
#
# - name: "Install PHP"
# uses: "shivammathur/setup-php@v2"
# with:
# php-version: "${{ matrix.php-version }}"
# extensions: "oci8"
# 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: "Setup Oracle user"
# run: |
# docker exec $(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: "Install dependencies with composer"
# run: "composer install --no-interaction --no-progress --no-suggest"
#
# - name: "Run PHPUnit"
# run: "vendor/bin/phpunit -c phpunit.oracle.xml --coverage-clover=coverage.xml"
#
# - name: "Upload Code Coverage"
# uses: "codecov/codecov-action@v1"

0 comments on commit 06ea34c

Please sign in to comment.