Skip to content

Commit

Permalink
Add Scrutinizer, add php 8.1 to the CI (#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
msmakouz committed Jan 10, 2022
1 parent 1a72ddc commit e013df4
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 10 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci-mssql.yml
Expand Up @@ -23,6 +23,9 @@ jobs:
- php: '8.0'
extensions: pdo, pdo_sqlsrv
mssql: 'server:2019-latest'
- php: '8.1'
extensions: pdo, pdo_sqlsrv-5.10.0beta2
mssql: 'server:2019-latest'

services:
mssql:
Expand Down Expand Up @@ -62,10 +65,11 @@ jobs:
run: composer self-update

- name: Install dependencies with composer
if: matrix.php != '8.2'
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Install dependencies with composer php 8.0
if: matrix.php == '8.0'
- name: Install dependencies with composer php 8.2
if: matrix.php == '8.2'
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Run tests with phpunit without coverage
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/ci-mysql.yml
Expand Up @@ -21,6 +21,7 @@ jobs:

php-version:
- "8.0"
- "8.1"

mysql-version:
- "5.7"
Expand Down Expand Up @@ -77,8 +78,13 @@ jobs:
php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
- name: Install dependencies with composer
if: matrix.php-version != '8.2'
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Install dependencies with composer php 8.2
if: matrix.php-version == '8.2'
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Run mysql tests with phpunit
env:
DB: mysql
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/ci-pgsql.yml
Expand Up @@ -20,6 +20,7 @@ jobs:
- ubuntu-latest
php-version:
- "8.0"
- "8.1"

pgsql-version:
- "10"
Expand Down Expand Up @@ -78,8 +79,13 @@ jobs:
php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
- name: Install dependencies with composer
if: matrix.php-version != '8.2'
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Install dependencies with composer php 8.2
if: matrix.php-version == '8.2'
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Run pgsql tests with phpunit
env:
DB: postgres
Expand Down
26 changes: 18 additions & 8 deletions .github/workflows/main.yml
Expand Up @@ -15,6 +15,7 @@ jobs:

php-version:
- "8.0"
- "8.1"
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -29,7 +30,7 @@ jobs:
php-version: ${{ matrix.php-version }}
coverage: pcov
tools: pecl
extensions: mbstring, pdo, pdo_sqlite, pdo_pgsql, pdo_sqlsrv, pdo_mysql
extensions: mbstring, pdo, pdo_sqlite, pdo_pgsql, pdo_sqlsrv-5.10.0beta2, pdo_mysql
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
Expand All @@ -39,17 +40,26 @@ jobs:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Dependencies
run: composer install --no-interaction --prefer-dist
- name: Install dependencies with composer
if: matrix.php-version != '8.2'
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
- name: Install dependencies with composer php 8.2
if: matrix.php-version == '8.2'
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
- name: Execute Tests
run: |
vendor/bin/phpunit --coverage-clover=coverage.xml
vendor/bin/phpunit --coverage-clover=coverage.clover
- name: Upload coverage to Codecov
continue-on-error: true # if is fork
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
file: ./coverage.clover
- name: Upload coverage to Scrutinizer
continue-on-error: true # if is fork
uses: sudo-bot/action-scrutinizer@latest
with:
cli-args: "--format=php-clover coverage.clover"

sqlite:
name: SQLite PHP ${{ matrix.php-version }}
Expand Down Expand Up @@ -84,11 +94,11 @@ jobs:
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies with composer
if: matrix.php-version != '8.1'
if: matrix.php-version != '8.2'
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Install dependencies with composer php 8.1
if: matrix.php-version == '8.1'
- name: Install dependencies with composer php 8.2
if: matrix.php-version == '8.2'
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Execute Tests
Expand Down
21 changes: 21 additions & 0 deletions .scrutinizer.yml
@@ -0,0 +1,21 @@
checks:
php: true

filter:
paths:
- "src/*"

tools:
external_code_coverage:
timeout: 900 # Timeout in seconds.
runs: 2 # How many code coverage submissions Scrutinizer will wait

build:
nodes:
analysis:
environment:
php: 8.0

tests:
override:
- php-scrutinizer-run

0 comments on commit e013df4

Please sign in to comment.