Skip to content

Commit

Permalink
GitHub actions less steps
Browse files Browse the repository at this point in the history
  • Loading branch information
jasny committed Dec 9, 2020
1 parent 6a774e5 commit d8d0b72
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
composer: '--prefer-lowest'
desc: "Lowest versions"
- php: 7.4
coverage: true
coverage: '--coverage-clover /tmp/clover.xml'
- php: 8.0
name: PHP ${{ matrix.php }} ${{ matrix.desc }}

Expand Down Expand Up @@ -46,18 +46,11 @@ jobs:
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer update --prefer-dist --no-progress --no-suggest ${{ matrix.composer }}

- name: Run PHPUnit (without coverage)
if: ${{ ! matrix.coverage }}
run: vendor/bin/phpunit --coverage-clover /tmp/clover.xml

- name: Download Scrutinizer Ocular
if: ${{ matrix.coverage }}
run: wget https://scrutinizer-ci.com/ocular.phar -O "/tmp/ocular.phar"

- name: Run PHPUnit (with coverage)
if: ${{ matrix.coverage }}
run: vendor/bin/phpunit --coverage-clover /tmp/clover.xml
- name: Run PHPUnit
run: vendor/bin/phpunit ${{ matrix.coverage }}

- name: Upload coverage to Scrutinizer
if: ${{ matrix.coverage }}
run: php "/tmp/ocular.phar" code-coverage:upload --format=php-clover /tmp/clover.xml
run: >
wget https://scrutinizer-ci.com/ocular.phar -O "/tmp/ocular.phar" &&
php "/tmp/ocular.phar" code-coverage:upload --format=php-clover /tmp/clover.xml

0 comments on commit d8d0b72

Please sign in to comment.