Skip to content

W3C Compatability Fixes #126

W3C Compatability Fixes

W3C Compatability Fixes #126

Workflow file for this run

name: CI
on:
push:
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
check_composer:
name: Check composer.json
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: '8.2'
- run: composer validate --strict --no-check-lock
static_analysis:
name: Static analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: '8.2'
- name: Install dependencies
run: composer update --ansi --no-progress --prefer-dist --no-interaction
- run: vendor/bin/phpstan analyze
tests:
name: Tests
runs-on: ubuntu-20.04
strategy:
matrix:
php: [ '7.2', '7.3', '7.4', '8.0', '8.1' ]
selenium: ['2.53.1', 'latest']
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: "xdebug"
php-version: "${{ matrix.php }}"
tools: composer
# PHP 7.1 development web server segfaults if timezone not set.
ini-values: date.timezone=Europe/Paris, error_reporting=-1, display_errors=On
- name: Install dependencies
run: |
composer update --no-interaction --prefer-dist
- name: Replace instaclick/php-webdriver with lullabot/php-webdriver for new selenium versions
run: |
if [ "${{ matrix.selenium }}" == "latest" ]; then
# @todo replace this with a release
composer require lullabot/php-webdriver:dev-main
fi
- name: Setup Mink test server
run: |
mkdir ./logs
./vendor/bin/mink-test-server &> ./logs/mink-test-server.log &
# To run this locally, additionally mount a volume with the repo to retrieve test files
# e.g. -v /home/youruser/MinkSelenium2Driver:/home/youruser/MinkSelenium2Driver
- name: Start Selenium
run: |
docker run --net host --name selenium --volume /dev/shm:/dev/shm --volume $GITHUB_ACTION_PATH:$GITHUB_ACTION_PATH --shm-size 2g selenium/standalone-firefox:${{ matrix.selenium }} &> ./logs/selenium.log &
- name: Wait for browser & PHP to start
run: |
while ! nc -z localhost 4444 </dev/null; do echo Waiting for remote driver to start...; sleep 1; done
while ! nc -z localhost 8002 </dev/null; do echo Waiting for PHP server to start...; sleep 1; done
- name: Run tests
run: |
if [ "${{ matrix.selenium }}" == "latest" ]; then
DRIVER_URL="http://localhost:4444" ./vendor/bin/phpunit -v --coverage-clover=coverage.xml
else
./vendor/bin/phpunit -v --coverage-clover=coverage.xml
fi
- name: Upload coverage
uses: codecov/codecov-action@v2
with:
files: coverage.xml
- name: Archive logs artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: logs_php-${{ matrix.php }}
path: |
logs