diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7c44fe01..1c9a7eba 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,7 +39,7 @@ jobs: tests: name: "Tests (PHP ${{ matrix.php }}, Selenium ${{ matrix.selenium_version }})${{ matrix.with_coverage == true && ' with coverage' || ''}}" - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: matrix: selenium_version: [ '2.53.1' ] @@ -74,24 +74,27 @@ jobs: composer update --no-interaction --prefer-dist - name: Setup Mink test server + env: + MINK_HOST: 0.0.0.0:8002 run: | mkdir ./logs ./vendor/bin/mink-test-server &> ./logs/mink-test-server.log & - name: Start Selenium run: | - docker run --net host --name selenium --volume /dev/shm:/dev/shm --volume ./vendor/mink/driver-testsuite/web-fixtures:/fixtures --shm-size 2g selenium/standalone-firefox:${{ matrix.selenium_version }} &> ./logs/selenium.log & + SELENIUM_IMAGE=selenium/standalone-firefox:${{ matrix.selenium_version }} docker compose up --wait - name: Wait for browser & PHP to start run: | - while ! nc -z localhost 4444 ./logs/selenium.log + - name: Archive logs artifacts if: ${{ failure() }} uses: actions/upload-artifact@v4 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..fa5f531e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,20 @@ +services: + selenium: + image: ${SELENIUM_IMAGE:-selenium/standalone-chrome:4} + hostname: selenium + shm_size: 2g + environment: + VNC_NO_PASSWORD: 1 + SCREEN_WIDTH: 1024 + SCREEN_HEIGHT: 768 + volumes: + - /dev/shm:/dev/shm + - ./vendor/mink/driver-testsuite/web-fixtures:/fixtures + ports: + - "4444:4444" + # VNC Web Viewer port (new images) + - "7900:7900" + # VNC Server port (old "-debug" images) + - "5900:5900" + extra_hosts: + - host.docker.internal:host-gateway