|
| 1 | +name: "Continuous Integration" |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + |
| 6 | +jobs: |
| 7 | + static-analysis-phpstan: |
| 8 | + name: "Static Analysis with PHPStan" |
| 9 | + runs-on: "ubuntu-latest" |
| 10 | + |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + php-version: |
| 14 | + - "7.4" |
| 15 | + |
| 16 | + steps: |
| 17 | + - name: "Checkout code" |
| 18 | + uses: "actions/checkout@v2" |
| 19 | + |
| 20 | + - name: "Install PHP" |
| 21 | + uses: "shivammathur/setup-php@v2" |
| 22 | + with: |
| 23 | + coverage: "none" |
| 24 | + php-version: "${{ matrix.php-version }}" |
| 25 | + tools: "cs2pr" |
| 26 | + |
| 27 | + - name: "Cache dependencies installed with composer" |
| 28 | + uses: "actions/cache@v1" |
| 29 | + with: |
| 30 | + path: "~/.composer/cache" |
| 31 | + key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" |
| 32 | + restore-keys: "php-${{ matrix.php-version }}-composer-locked-" |
| 33 | + |
| 34 | + - name: "Install dependencies with composer" |
| 35 | + run: "composer install --no-interaction --no-progress --no-suggest" |
| 36 | + |
| 37 | + - name: "Run a static analysis with phpstan/phpstan" |
| 38 | + run: "composer phpstan -- --error-format=checkstyle | cs2pr" |
| 39 | + |
| 40 | + coding-standards: |
| 41 | + name: "Coding Standards" |
| 42 | + runs-on: "ubuntu-latest" |
| 43 | + |
| 44 | + strategy: |
| 45 | + matrix: |
| 46 | + php-version: |
| 47 | + - "7.4" |
| 48 | + |
| 49 | + steps: |
| 50 | + - name: "Checkout" |
| 51 | + uses: "actions/checkout@v2" |
| 52 | + |
| 53 | + - name: "Install PHP" |
| 54 | + uses: "shivammathur/setup-php@v2" |
| 55 | + with: |
| 56 | + coverage: "none" |
| 57 | + php-version: "${{ matrix.php-version }}" |
| 58 | + tools: "cs2pr" |
| 59 | + |
| 60 | + - name: "Cache dependencies installed with composer" |
| 61 | + uses: "actions/cache@v1" |
| 62 | + with: |
| 63 | + path: "~/.composer/cache" |
| 64 | + key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" |
| 65 | + restore-keys: "php-${{ matrix.php-version }}-composer-locked-" |
| 66 | + |
| 67 | + - name: "Install dependencies with composer" |
| 68 | + run: "composer install --no-interaction --no-progress --no-suggest" |
| 69 | + |
| 70 | + - name: "Run PHP-CS-Fixer on src/" |
| 71 | + run: "vendor/bin/php-cs-fixer fix src/ --dry-run --stop-on-violation --report=checkstyle | cs2pr" |
| 72 | + |
| 73 | + - name: "Run PHP-CS-Fixer on tests/" |
| 74 | + run: "vendor/bin/php-cs-fixer fix tests/ --dry-run --stop-on-violation --report=checkstyle | cs2pr" |
| 75 | + |
| 76 | + phpunit-mysql57: |
| 77 | + name: "PHPUnit on MySQL 5.7" |
| 78 | + runs-on: "ubuntu-latest" |
| 79 | + |
| 80 | + strategy: |
| 81 | + matrix: |
| 82 | + php-version: |
| 83 | + - "7.4" |
| 84 | + |
| 85 | + services: |
| 86 | + mysql: |
| 87 | + image: "mysql: 5.7" |
| 88 | + env: |
| 89 | + MYSQL_ALLOW_EMPTY_PASSWORD: true |
| 90 | + MYSQL_ROOT_PASSWORD: |
| 91 | + ports: |
| 92 | + - "3306:3306" |
| 93 | + |
| 94 | + steps: |
| 95 | + - name: "Checkout" |
| 96 | + uses: "actions/checkout@v2" |
| 97 | + |
| 98 | + - name: "Install PHP" |
| 99 | + uses: "shivammathur/setup-php@v2" |
| 100 | + with: |
| 101 | + php-version: "${{ matrix.php-version }}" |
| 102 | + extensions: "oci8" |
| 103 | + coverage: "pcov" |
| 104 | + |
| 105 | + - name: "Cache dependencies installed with composer" |
| 106 | + uses: "actions/cache@v1" |
| 107 | + with: |
| 108 | + path: "~/.composer/cache" |
| 109 | + key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" |
| 110 | + restore-keys: "php-${{ matrix.php-version }}-composer-locked-" |
| 111 | + |
| 112 | + - name: "Install dependencies with composer" |
| 113 | + run: "composer install --no-interaction --no-progress --no-suggest" |
| 114 | + |
| 115 | + - name: "Run PHPUnit" |
| 116 | + run: "vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover=coverage.xml" |
| 117 | + |
| 118 | + - name: "Upload Code Coverage" |
| 119 | + uses: "codecov/codecov-action@v1" |
| 120 | + |
| 121 | + phpunit-oci8: |
| 122 | + name: "PHPUnit on OCI8" |
| 123 | + runs-on: "ubuntu-latest" |
| 124 | + |
| 125 | + strategy: |
| 126 | + matrix: |
| 127 | + php-version: |
| 128 | + - "7.4" |
| 129 | + |
| 130 | + services: |
| 131 | + oracle: |
| 132 | + image: "wnameless/oracle-xe-11g-r2" |
| 133 | + ports: |
| 134 | + - "1521:1521" |
| 135 | + |
| 136 | + steps: |
| 137 | + - name: "Checkout" |
| 138 | + uses: "actions/checkout@v2" |
| 139 | + |
| 140 | + - name: "Install PHP" |
| 141 | + uses: "shivammathur/setup-php@v2" |
| 142 | + with: |
| 143 | + php-version: "${{ matrix.php-version }}" |
| 144 | + extensions: "oci8" |
| 145 | + coverage: "pcov" |
| 146 | + |
| 147 | + - name: "Cache dependencies installed with composer" |
| 148 | + uses: "actions/cache@v1" |
| 149 | + with: |
| 150 | + path: "~/.composer/cache" |
| 151 | + key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" |
| 152 | + restore-keys: "php-${{ matrix.php-version }}-composer-locked-" |
| 153 | + |
| 154 | + - name: "Install dependencies with composer" |
| 155 | + run: "composer install --no-interaction --no-progress --no-suggest" |
| 156 | + |
| 157 | + - name: "Run PHPUnit" |
| 158 | + run: "vendor/bin/phpunit -c phpunit.oracle.xml --coverage-clover=coverage.xml" |
| 159 | + |
| 160 | + - name: "Upload Code Coverage" |
| 161 | + uses: "codecov/codecov-action@v1" |
0 commit comments