Skip to content

Add Options classes (Page, Locator, Selector, Tracing, Websocket, ...) #138

Add Options classes (Page, Locator, Selector, Tracing, Websocket, ...)

Add Options classes (Page, Locator, Selector, Tracing, Websocket, ...) #138

Workflow file for this run

name: "CI"
on:
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]
workflow_dispatch:
permissions:
contents: read
jobs:
cs:
name: "Code style"
runs-on: ubuntu-latest
steps:
- name: "Git: checkout"
uses: actions/checkout@v4
- name: "PHP: setup 8.3"
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
coverage: none
tools: php-cs-fixer
- name: "Composer: validate"
run: composer validate --strict
- name: "Composer: install"
run: composer install --prefer-dist --no-interaction --no-progress
- name: "Php-CS-Fixer: version"
run: vendor/bin/php-cs-fixer -V
- name: "Php-CS-Fixer: check"
run: vendor/bin/php-cs-fixer fix --diff --dry-run
sa:
name: "Static Analysis"
runs-on: ubuntu-latest
steps:
- name: "Git: checkout"
uses: actions/checkout@v4
- name: "PHP: setup 8.4"
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
tools: phpstan
- name: "Composer: install"
run: composer install --prefer-dist --no-interaction --no-progress
- name: "PHPStan: version"
run: phpstan --version
- name: "PHPStan: analyze"
run: phpstan
unit-tests:
name: "Unit Tests (PHP ${{ matrix.php-version }})"
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['8.2', '8.3', '8.4']
fail-fast: false
steps:
- name: "Git: checkout"
uses: actions/checkout@v4
- name: "PHP: setup ${{ matrix.php-version }}"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: pcov
tools: phpunit
# Force PHPUnit 11.5 on PHP 8.2 to keep support for it
# https://phpunit.de/supported-versions.html
- name: "PHPUnit: install 11.5"
if: matrix.php-version == '8.2'
run: composer require --no-update phpunit/phpunit:^11.5
- name: "Composer: install (${{ matrix.dependencies }})"
run: |
if [ "${{ matrix.dependencies }}" == "low" ]; then
composer update --prefer-lowest --prefer-dist --no-interaction --no-progress
else
composer install --prefer-dist --no-interaction --no-progress
fi
- name: "PHPUnit: version"
run: phpunit --version
- name: "PHPUnit: tests"
run: phpunit --testsuite=unit
integration-tests:
name: "Integration Tests (PHP ${{ matrix.php-version }} ${{ matrix.dependencies }})"
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php-version: '8.2'
dependencies: 'low'
- php-version: '8.3'
dependencies: 'high'
- php-version: '8.4'
dependencies: 'high'
fail-fast: false
steps:
- name: "Git: checkout"
uses: actions/checkout@v4
- name: "PHP: setup ${{ matrix.php-version }}"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: pcov
tools: phpunit
# Force PHPUnit 11.5 on PHP 8.2 to keep support for it
# https://phpunit.de/supported-versions.html
- if: matrix.php-version == '8.2'
run: composer require --no-update phpunit/phpunit:^11.5
- name: "Node: setup"
uses: actions/setup-node@v4
with:
node-version: '20'
- name: "Composer: install (${{ matrix.dependencies }})"
run: |
if [ "${{ matrix.dependencies }}" == "low" ]; then
composer update --prefer-lowest --prefer-dist --no-interaction --no-progress
else
composer install --prefer-dist --no-interaction --no-progress
fi
- name: "Playwright: install browsers"
run: php bin/playwright-install --browsers
- name: "PHPUnit: version"
run: vendor/bin/phpunit --version
- name: "PHPUnit: all tests with coverage"
run: vendor/bin/phpunit --coverage-clover=coverage.xml
- name: "Codecov: upload coverage"
uses: codecov/codecov-action@v5
if: matrix.php-version == '8.4' && matrix.dependencies == 'high'
with:
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false