Skip to content

Commit

Permalink
Collect coverage only once per Selenium Server version (#402)
Browse files Browse the repository at this point in the history
Collect coverage only once per Selenium Server version
  • Loading branch information
aik099 authored Nov 15, 2024
1 parent d9df3d5 commit e778774
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,20 @@ jobs:
- run: vendor/bin/phpstan analyze

tests:
name: "Tests (PHP ${{ matrix.php }}, Selenium ${{ matrix.selenium_version }})"
name: "Tests (PHP ${{ matrix.php }}, Selenium ${{ matrix.selenium_version }})${{ matrix.with_coverage == true && ' with coverage' || ''}}"
runs-on: ubuntu-20.04
strategy:
matrix:
selenium_version: [ '2.53.1' ]
php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ]
php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ]
with_coverage: [ false ]
include:
- selenium_version: '2.53.1'
php: '8.3'
with_coverage: true
- selenium_version: '3.141.59'
php: '8.3'
with_coverage: true
fail-fast: false

steps:
Expand Down Expand Up @@ -82,7 +87,8 @@ jobs:
while ! nc -z localhost 4444 </dev/null; do echo Waiting for remote driver to start...; sleep 1; done
while ! nc -z localhost 8002 </dev/null; do echo Waiting for PHP server to start...; sleep 1; done
- name: Run tests
- name: Run tests with Coverage
if: "${{ matrix.with_coverage == true }}"
env:
SELENIUM_VERSION: ${{ matrix.selenium_version }}
DRIVER_URL: http://localhost:4444/wd/hub
Expand All @@ -91,7 +97,18 @@ jobs:
run: |
vendor/bin/phpunit -v --coverage-clover=coverage.xml
- name: Run tests without Coverage
if: "${{ matrix.with_coverage == false }}"
env:
SELENIUM_VERSION: ${{ matrix.selenium_version }}
DRIVER_URL: http://localhost:4444/wd/hub
WEB_FIXTURES_BROWSER: firefox
DRIVER_MACHINE_BASE_PATH: /fixtures/
run: |
vendor/bin/phpunit -v
- name: Upload coverage
if: "${{ matrix.with_coverage == true }}"
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down

0 comments on commit e778774

Please sign in to comment.