Skip to content

Commit

Permalink
Merge 5cfa248 into 0093d98
Browse files Browse the repository at this point in the history
  • Loading branch information
moufmouf committed Jul 22, 2020
2 parents 0093d98 + 5cfa248 commit 0950c12
Showing 1 changed file with 161 additions and 0 deletions.
161 changes: 161 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
name: "Continuous Integration"

on:
pull_request:

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

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

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

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

- 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 a static analysis with phpstan/phpstan"
run: "composer phpstan -- --error-format=checkstyle | cs2pr"

coding-standards:
name: "Coding Standards"
runs-on: "ubuntu-latest"

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

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"

- 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 PHP-CS-Fixer on src/"
run: "vendor/bin/php-cs-fixer fix src/ --dry-run --stop-on-violation --report=checkstyle | cs2pr"

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

phpunit-mysql57:
name: "PHPUnit on MySQL 5.7"
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:
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: "Install dependencies with composer"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Run PHPUnit"
run: "vendor/bin/phpunit -c phpunit.xml.dist --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: "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 0950c12

Please sign in to comment.