2828 test :
2929 strategy :
3030 matrix :
31- os : [macos-latest, ubuntu-latest, windows-latest]
32- php-version : ['7.4']
31+ os : [ macos-latest, ubuntu-latest, windows-latest ]
32+ php-version : [ '7.4' ]
3333 include :
3434 - os : ubuntu-latest
3535 php-version : ' 7.2'
@@ -41,17 +41,26 @@ jobs:
4141 - os : ubuntu-latest
4242 php-version : ' 8.0'
4343 composer_flags : ' --ignore-platform-reqs'
44+
4445 runs-on : ${{ matrix.os }}
46+
4547 steps :
4648 - name : Checkout
4749 uses : actions/checkout@v2
4850
51+ - name : Get code coverage driver
52+ 53+ id : coverage-driver
54+ with :
55+ script : ' return "${{ matrix.os }}" == "ubuntu-latest" && "${{ matrix.php-version }}" == "7.4" ? "pcov" : "none"'
56+ result-encoding : string
57+
4958 - name : Setup PHP
5059 uses : shivammathur/setup-php@v2
5160 with :
5261 php-version : ${{ matrix.php-version }}
5362 ini-values : pcov.directory=$GITHUB_WORKSPACE
54- coverage : pcov
63+ coverage : ${{ steps.coverage-driver.outputs.result }}
5564
5665 - name : Get Composer data directory
5766 id : composer-data
@@ -78,17 +87,17 @@ jobs:
7887 - name : Install dependencies
7988 run : composer update --no-progress ${{ matrix.composer_flags }}
8089
81- - name : Test
90+ - name : Run tests
8291 run : composer test -- --coverage-clover=./build/logs/clover.xml
8392
8493 - name : Upload coverage results to Coveralls
85- if : matrix.os == 'ubuntu-latest' && matrix.php-version == '7.4 '
94+ if : steps.coverage-driver.outputs.result != 'none '
8695 env :
8796 COVERALLS_REPO_TOKEN : ${{ secrets.GITHUB_TOKEN }}
8897 run : |
89- composer require --dev twinh /php-coveralls
98+ composer require --dev php-coveralls /php-coveralls --quiet
9099 ./vendor/bin/php-coveralls --verbose
91100
92101 - name : Run Infection
93- if : matrix.os == 'ubuntu-latest' && matrix.php-version == '7.4 '
102+ if : steps.coverage-driver.outputs.result != 'none '
94103 run : composer infection
0 commit comments