Skip to content

Commit

Permalink
Use "docker-composer.yml" file during the build
Browse files Browse the repository at this point in the history
  • Loading branch information
aik099 committed Jan 11, 2025
1 parent bedccba commit 360d6b0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' ]
Expand Down Expand Up @@ -74,13 +74,15 @@ 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: |
Expand All @@ -92,6 +94,7 @@ jobs:
env:
SELENIUM_VERSION: ${{ matrix.selenium_version }}
DRIVER_URL: http://localhost:4444/wd/hub
WEB_FIXTURES_HOST: http://host.docker.internal:8002
WEB_FIXTURES_BROWSER: firefox
DRIVER_MACHINE_BASE_PATH: /fixtures/
run: |
Expand All @@ -102,6 +105,7 @@ jobs:
env:
SELENIUM_VERSION: ${{ matrix.selenium_version }}
DRIVER_URL: http://localhost:4444/wd/hub
WEB_FIXTURES_HOST: http://host.docker.internal:8002
WEB_FIXTURES_BROWSER: firefox
DRIVER_MACHINE_BASE_PATH: /fixtures/
run: |
Expand All @@ -120,6 +124,11 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Extract docker logs
if: ${{ failure() }}
run: |
docker compose logs --no-color &> ./logs/selenium.log
- name: Archive logs artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v4
Expand Down
20 changes: 20 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 360d6b0

Please sign in to comment.