Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Test

on:
push:
branches:
- master
pull_request:
types: [ opened, synchronize, reopened ]

Expand Down Expand Up @@ -43,11 +46,12 @@ jobs:
- name: Execute Unit, Integration and Acceptance Tests
run: composer test

- name: Upload Coverage Report
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
flags: unittests
fail_ci_if_error: true
- name: Fix coverage.xml for Sonar
run: |
sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage.xml

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
composer.phar
/vendor/
.idea/
/infrastructure
/infrastructure/
/coverage/
*[N|n]o[G|g]it*
*coverage*
coverage.xml
test.xml
.phpunit.result.cache
composer.lock
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Criteria (a.k.a Filter)

[![Test](https://github.com/ComplexHeart/php-criteria/actions/workflows/test.yml/badge.svg)](https://github.com/ComplexHeart/php-criteria/actions/workflows/test.yml)
[![codecov](https://codecov.io/gh/ComplexHeart/php-criteria/branch/main/graph/badge.svg?token=T86pvAqfl6)](https://codecov.io/gh/ComplexHeart/php-criteria)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ComplexHeart_php-criteria&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=ComplexHeart_php-criteria)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=ComplexHeart_php-criteria&metric=coverage)](https://sonarcloud.io/summary/new_code?id=ComplexHeart_php-criteria)

Small implementation of a filter criteria pattern in PHP for Complex Heart SDK. Compose several filters using fluent
interface.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
}
},
"scripts": {
"test": "vendor/bin/pest --configuration=phpunit.xml --coverage-clover=coverage.xml",
"test": "vendor/bin/pest --configuration=phpunit.xml --coverage-clover=coverage.xml --log-junit=test.xml",
"analyse": "vendor/bin/phpstan analyse src --no-progress --level=5"
},
"config": {
Expand Down
20 changes: 10 additions & 10 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="Test Suite">
<directory>./tests</directory>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Test Suite">
<directory>./tests</directory>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
</coverage>
</phpunit>
10 changes: 10 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
sonar.projectName=Complex Heart Criteria
sonar.projectKey=ComplexHeart_php-criteria
sonar.organization=complexheart
sonar.language=php
sonar.sources=./src
sonar.tests=./tests
sonar.inclusions=./src/**
sonar.exclusions=./tests/**
sonar.php.coverage.reportPaths=coverage.xml
sonar.php.tests.reportPaths=phpunit.xml