Skip to content

trigger

trigger #265

Workflow file for this run

on:
push: ~
env:
DRIVER_URL: "http://localhost:4444"
WEB_FIXTURES_HOST: "http://localhost:8002"
USE_SAFARI_TECHNOLOGY_PREVIEW: "false"
defaults:
run:
shell: bash
jobs:
static:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ 8.2 ]
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
extensions: zip, :xdebug
tools: composer
- id: composer-cache
run: echo "::set-output name=directory::$(composer config cache-dir)"
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.directory }}
key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ matrix.php }}-composer-
- run: composer update --prefer-dist
- name: Style
run: |
./bin/php-cs-fixer fix -v --diff --dry-run --rules=@Symfony
- name: Static
run: |
./bin/phpstan analyze
tests:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [ 8.0, 8.1, 8.2 ]
browser: [ chrome, firefox ]
experimental: [false]
use_safari_technology_preview: [false]
include:
- php: 8.2
experimental: true
browser: chrome
os: macos-latest
- php: 8.2
experimental: true
browser: firefox
os: macos-latest
- php: 8.2
experimental: true
browser: safari
os: macos-latest
- php: 8.2
experimental: true
browser: safari
os: macos-latest
use_safari_technology_preview: true
- php: 8.3
experimental: true
browser: chrome
os: ubuntu-latest
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
extensions: zip, :xdebug
tools: composer
- name: Determine composer cache directory
id: composer-cache
run: echo "::set-output name=directory::$(composer config cache-dir)"
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.directory }}
key: ${{ matrix.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ matrix.php }}-composer-
- name: Install dependencies
run: |
mkdir -p ./logs
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
echo "::group::apt-get install"
sudo apt-get install xvfb
echo "::endgroup::"
fi;
echo "::group::composer update"
composer update --no-interaction --prefer-dist
echo "::endgroup::"
echo "::group::composer require symfony/phpunit-bridge"
composer require symfony/phpunit-bridge
echo "::endgroup::"
- uses: browser-actions/setup-chrome@latest
if: matrix.browser == 'chrome'
- uses: browser-actions/setup-firefox@latest
if: matrix.browser == 'firefox'
- uses: browser-actions/setup-geckodriver@latest
if: matrix.browser == 'firefox'
- if: matrix.browser == 'safari' && matrix.use_safari_technology_preview == true
run: |
brew tap homebrew/cask-versions
brew install --cask safari-technology-preview
- name: Start ChromeDriver
if: ${{ matrix.browser == 'chrome' }}
run: |
if [[ "${{ matrix.os }}" == "macos-latest" ]]; then
chromedriver --port=4444 --verbose --whitelisted-ips= &> ./logs/chromedriver.log &
else
xvfb-run --server-args="-screen 0, 1280x720x24" --auto-servernum \
chromedriver --port=4444 --verbose --whitelisted-ips= &> ./logs/chromedriver.log &
fi;
while ! nc -z localhost 4444 </dev/null; do echo Waiting for driver to start...; sleep 1; done
- name: Start GeckoDriver
if: ${{ matrix.browser == 'firefox' }}
run: |
if [[ "${{ matrix.os }}" == "macos-latest" ]]; then
geckodriver --host 127.0.0.1 -vv --port 4444 &> ./logs/geckodriver.log &
else
xvfb-run --server-args="-screen 0, 1280x720x24" --auto-servernum \
geckodriver --host 127.0.0.1 -vv --port 4444 &> ./logs/geckodriver.log &
fi;
while ! nc -z localhost 4444 </dev/null; do echo Waiting for driver to start...; sleep 1; done
- name: Start SafariDriver
if: ${{ matrix.browser == 'safari' }}
run: |
if [[ "${{ matrix.use_safari_technology_preview }}" == true ]]; then
defaults read /Applications/Safari\ Technology\ Preview.app/Contents/Info CFBundleShortVersionString
else
defaults read /Applications/Safari.app/Contents/Info CFBundleShortVersionString
fi;
if [[ "${{ matrix.use_safari_technology_preview }}" == true ]]; then
/Applications/Safari\ Technology\ Preview.app/Contents/MacOS/safaridriver -p 4444 --diagnose &
else
/usr/bin/safaridriver -p 4444 --diagnose &
fi;
while ! nc -z localhost 4444 </dev/null; do echo Waiting for driver to start...; sleep 1; done
- name: Start webserver
shell: bash
run: |
export USE_ZEND_ALLOC=0
php -S localhost:8002 -t ./vendor/mink/driver-testsuite/web-fixtures &> ./logs/mink-test-server.log &
- name: Run tests
env:
SYMFONY_DEPRECATIONS_HELPER: 'max[total]=999999'
BROWSER_NAME: ${{ matrix.browser }}
USE_SAFARI_TECHNOLOGY_PREVIEW: ${{ matrix.use_safari_technology_preview }}
run: |
./bin/phpunit -v
- name: Archive logs artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: logs_browser-${{ matrix.os }}-${{ matrix.browser }}_php-${{ matrix.php }}
path: logs