Skip to content

Commit

Permalink
added headless to matrix (#94)
Browse files Browse the repository at this point in the history
* added headless to matrix

* changed job name

* fix: Archive logs artifacts name

* trigger
  • Loading branch information
oleg-andreyev authored Dec 28, 2024
1 parent c521cb0 commit d5975f5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
25 changes: 22 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ defaults:

jobs:
static:
name: Static analysis
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -55,12 +56,14 @@ jobs:
php: [ 8.1, 8.2, 8.3 ]
browser: [ chrome, firefox ]
experimental: [false]
headless: [true, false]
include:
- php: 8.4
experimental: true
browser: chrome
continue-on-error: ${{ matrix.experimental }}
timeout-minutes: 5
name: PHP=${{ matrix.php }}; Browser=${{ matrix.browser }}; Headless=${{ matrix.headless }}; Experimental=${{ matrix.experimental }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -112,16 +115,24 @@ jobs:
- name: Start ChromeDriver
if: ${{ matrix.browser == 'chrome' }}
run: |
xvfb-run --server-args="-screen 0, 1280x720x24" --auto-servernum \
if [ ${{ matrix.headless }} == "true" ]; 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: |
xvfb-run --server-args="-screen 0, 1280x720x24" --auto-servernum \
if [ ${{ matrix.headless }} == "true" ]; 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
Expand All @@ -136,12 +147,20 @@ jobs:
SYMFONY_DEPRECATIONS_HELPER: 'max[total]=999999'
BROWSER_NAME: ${{ matrix.browser }}
run: |
if [ ${{ matrix.headless }} == "true" ]; then
if [ ${{ matrix.browser }} == "chrome" ]; then
export DRIVER_OPTIONS='{"args":["headless=new"]}'
elif [ ${{ matrix.browser }} == "firefox" ]; then
export DRIVER_OPTIONS='{"args": ["-headless"]}'
fi
fi
./bin/phpunit -v
- name: Archive logs artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: logs_browser-${{ matrix.browser }}_php-${{ matrix.php }}
name: logs_browser-${{ matrix.browser }}_php-${{ matrix.php }}_headless-${{ matrix.headless }}_experimental-${{ matrix.experimental }}
path: |
logs
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ Follow https://github.com/shivammathur/setup-php#local-testing-setup

## Copyright

Copyright (c) 2024 Oleg Andreyev <[email protected]>
Copyright (c) 2024 Oleg Andreyev <[email protected]>

0 comments on commit d5975f5

Please sign in to comment.