Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logs always() #78

Merged
merged 8 commits into from
Nov 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 25 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
experimental: true
browser: chrome
continue-on-error: ${{ matrix.experimental }}
timeout-minutes: 10
timeout-minutes: 5
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -54,6 +54,8 @@ jobs:

- name: Install dependencies
run: |
mkdir -p ./logs

echo "::group::apt-get install"
sudo apt-get install xvfb
echo "::endgroup::"
Expand All @@ -66,23 +68,35 @@ jobs:
composer require symfony/phpunit-bridge
echo "::endgroup::"

- name: Start webdriver
shell: bash
- 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: |
mkdir -p ./logs
if [[ "${{ matrix.browser }}" == "chrome" ]]; then
xvfb-run --auto-servernum $CHROMEWEBDRIVER/chromedriver --port=4444 --verbose --whitelisted-ips= &> ./logs/webdriver.log &
else
xvfb-run --auto-servernum $GECKOWEBDRIVER/geckodriver --host 127.0.0.1 -vv --port 4444 &>./logs/webdriver.log &
fi;
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
mkdir -p ./logs
php -S localhost:8002 -t ./vendor/mink/driver-testsuite/web-fixtures &> ./logs/mink-test-server.log &

- name: Run tests
Expand All @@ -93,7 +107,7 @@ jobs:
./vendor/bin/simple-phpunit -v

- name: Archive logs artifacts
if: ${{ failure() }}
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: logs_browser-${{ matrix.browser }}_php-${{ matrix.php }}
Expand Down