Skip to content

Commit

Permalink
Coverage fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Mar 11, 2023
1 parent 7ca2a07 commit 6d2edce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/php.yml
Expand Up @@ -44,7 +44,8 @@ jobs:
# https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
# Should be the higest supported version, so we can use the newest tools
php-version: '8.2'
tools: composer:v2
extensions: ctype, dom, spl, xml

Expand Down Expand Up @@ -104,6 +105,7 @@ jobs:
# https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v2
with:
# Should be the lowest supported version
php-version: '8.0'
extensions: ctype, dom, spl, xml
tools: composer:v2
Expand Down Expand Up @@ -184,19 +186,20 @@ jobs:
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Run unit tests with coverage
if: ${{ matrix.php-versions == '8.1' }}
if: ${{ matrix.php-versions == '8.2' }}
run: vendor/bin/phpunit

- name: Run unit tests (no coverage)
if: ${{ matrix.php-versions != '8.1' }}
if: ${{ matrix.php-versions != '8.2' }}
run: vendor/bin/phpunit --no-coverage

- name: Save coverage data
if: ${{ matrix.php-versions == '8.1' }}
if: ${{ matrix.php-versions == '8.2' }}
uses: actions/upload-artifact@v3
with:
name: coverage-data
path: ${{ github.workspace }}/build
# The build-directory alone is not enough to make codecov work
path: ${{ github.workspace }}

unit-tests-windows:
name: "Syntax and unit tests, PHP ${{ matrix.php-versions }}, ${{ matrix.operating-system }}"
Expand Down Expand Up @@ -256,7 +259,7 @@ jobs:
- uses: actions/download-artifact@v3
with:
name: coverage-data
path: ${{ github.workspace }}/build
path: ${{ github.workspace }}

- name: Codecov
uses: codecov/codecov-action@v3
6 changes: 3 additions & 3 deletions codecov.yml
Expand Up @@ -6,14 +6,14 @@ coverage:
default:
target: 0%
threshold: 2%
patch: false
patch: off

comment:
layout: "diff"
behavior: once
require_changes: true
require_base: false
require_head: true
require_base: no
require_head: yes
branches: null

github_checks:
Expand Down

0 comments on commit 6d2edce

Please sign in to comment.