Skip to content

Commit

Permalink
Publish coverage last
Browse files Browse the repository at this point in the history
  • Loading branch information
inxilpro committed Jun 17, 2021
1 parent 58ce004 commit 0be9192
Showing 1 changed file with 32 additions and 8 deletions.
40 changes: 32 additions & 8 deletions .github/workflows/phpunit.yml
Expand Up @@ -16,16 +16,11 @@ jobs:
laravel: [^8.0, ^7.0]
dependency-version: [lowest, stable]
include:
# - laravel: dev-master
# testbench: dev-master
# minimum-stability: dev
- laravel: ^8.0
testbench: ^6.0
coverage: pcov
minimum-stability: stable
- laravel: ^7.0
testbench: ^5.0
coverage: none
minimum-stability: stable

name: "${{ matrix.php }} / ${{ matrix.laravel }} (${{ matrix.dependency-version }})"
Expand All @@ -39,7 +34,7 @@ jobs:
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, bcmath, intl, iconv
coverage: ${{ matrix.coverage }}
coverage: none

- name: Cache dependencies
uses: actions/cache@v2
Expand All @@ -60,11 +55,40 @@ jobs:
COMPOSER_DISCARD_CHANGES: true
run: composer update --no-suggest --no-progress --no-interaction --no-suggest --prefer-dist --with-all-dependencies --prefer-${{ matrix.dependency-version }}

- name: Execute tests
run: vendor/bin/phpunit

coverage:
runs-on: ubuntu-latest

name: Publish code coverage

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: dom, curl, libxml, mbstring, zip, pcntl, bcmath, intl, iconv
coverage: pcov

- name: Cache dependencies
uses: actions/cache@v2
with:
path: vendor
key: composer-${{ hashFiles('composer.json') }}

- name: Install dependencies
env:
COMPOSER_DISCARD_CHANGES: true
run: composer require --no-suggest --no-progress --no-interaction --prefer-dist --update-with-all-dependencies "laravel/framework:^8.0" "orchestra/testbench:^6.0"

- name: Execute tests
run: vendor/bin/phpunit --coverage-clover ${{ github.workspace }}/clover.xml

- if: matrix.coverage == 'pcov'
name: Publish code coverage
- name: Publish code coverage
uses: paambaati/codeclimate-action@v2.4.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
Expand Down

0 comments on commit 0be9192

Please sign in to comment.