- fixing ci for 1.3 #281
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- "master" | |
- "1.3" | |
pull_request: | |
branches: | |
- "master" | |
- "1.3" | |
env: | |
DRIVER_URL: "http://localhost:4444" | |
WEB_FIXTURES_HOST: "http://localhost:8002" | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
static: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
php: [ 8.0 ] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
coverage: none | |
extensions: zip, :xdebug | |
tools: composer | |
- id: composer-cache | |
run: echo "directory=$(composer config cache-dir)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v4 | |
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: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
php: [ 8.0, 8.1, 8.2, 8.3 ] | |
browser: [ chrome, firefox ] | |
experimental: [false] | |
continue-on-error: ${{ matrix.experimental }} | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- 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 "directory=$(composer config cache-dir)" >> $GITHUB_OUTPUT | |
- name: Cache composer dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.composer-cache.outputs.directory }} | |
key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ matrix.php }}-composer- | |
- name: Install dependencies | |
run: | | |
mkdir -p ./logs | |
echo "::group::apt-get install" | |
sudo apt-get install xvfb | |
echo "::endgroup::" | |
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' | |
- name: Start ChromeDriver | |
if: ${{ matrix.browser == 'chrome' }} | |
run: | | |
xvfb-run --server-args="-screen 0, 1280x720x24" --auto-servernum \ | |
chromedriver --port=4444 --verbose --whitelisted-ips= &> ./logs/chromedriver.log & | |
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: | | |
xvfb-run --server-args="-screen 0, 1280x720x24" --auto-servernum \ | |
geckodriver --host 127.0.0.1 -vv --port 4444 &> ./logs/geckodriver.log & | |
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 }} | |
run: | | |
./bin/phpunit -v | |
- name: Archive logs artifacts | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: logs_browser-${{ matrix.browser }}_php-${{ matrix.php }} | |
path: | | |
logs |