File tree 6 files changed +38
-21
lines changed 6 files changed +38
-21
lines changed Original file line number Diff line number Diff line change 1
1
name : Test
2
2
3
3
on :
4
+ push :
5
+ branches :
6
+ - master
4
7
pull_request :
5
8
types : [ opened, synchronize, reopened ]
6
9
@@ -43,11 +46,12 @@ jobs:
43
46
- name : Execute Unit, Integration and Acceptance Tests
44
47
run : composer test
45
48
46
- - name : Upload Coverage Report
47
- uses : codecov/codecov-action@v2
48
- with :
49
- token : ${{ secrets.CODECOV_TOKEN }}
50
- files : ./coverage.xml
51
- flags : unittests
52
- fail_ci_if_error : true
49
+ - name : Fix coverage.xml for Sonar
50
+ run : |
51
+ sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage.xml
53
52
53
+ - name : SonarCloud Scan
54
+ uses : SonarSource/sonarcloud-github-action@master
55
+ env :
56
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
57
+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
Original file line number Diff line number Diff line change 1
1
composer.phar
2
2
/vendor /
3
3
.idea /
4
- /infrastructure
4
+ /infrastructure /
5
+ /coverage /
5
6
* [N|n ]o [G|g ]it *
6
- * coverage *
7
+ coverage.xml
8
+ test.xml
7
9
.phpunit.result.cache
8
10
composer.lock
Original file line number Diff line number Diff line change 1
1
# Criteria (a.k.a Filter)
2
2
3
3
[ ![ Test] ( https://github.com/ComplexHeart/php-criteria/actions/workflows/test.yml/badge.svg )] ( https://github.com/ComplexHeart/php-criteria/actions/workflows/test.yml )
4
- [ ![ codecov] ( https://codecov.io/gh/ComplexHeart/php-criteria/branch/main/graph/badge.svg?token=T86pvAqfl6 )] ( https://codecov.io/gh/ComplexHeart/php-criteria )
4
+ [ ![ 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 )
5
+ [ ![ Coverage] ( https://sonarcloud.io/api/project_badges/measure?project=ComplexHeart_php-criteria&metric=coverage )] ( https://sonarcloud.io/summary/new_code?id=ComplexHeart_php-criteria )
5
6
6
7
Small implementation of a filter criteria pattern in PHP for Complex Heart SDK. Compose several filters using fluent
7
8
interface.
Original file line number Diff line number Diff line change 30
30
}
31
31
},
32
32
"scripts" : {
33
- "test" : " vendor/bin/pest --configuration=phpunit.xml --coverage-clover=coverage.xml" ,
33
+ "test" : " vendor/bin/pest --configuration=phpunit.xml --coverage-clover=coverage.xml --log-junit=test.xml " ,
34
34
"analyse" : " vendor/bin/phpstan analyse src --no-progress --level=5"
35
35
},
36
36
"config" : {
Original file line number Diff line number Diff line change 4
4
bootstrap =" vendor/autoload.php"
5
5
colors =" true"
6
6
>
7
- <testsuites >
8
- <testsuite name =" Test Suite" >
9
- <directory >./tests</directory >
10
- </testsuite >
11
- </testsuites >
12
- <coverage processUncoveredFiles =" true" >
13
- <include >
14
- <directory suffix =" .php" >./src</directory >
15
- </include >
16
- </coverage >
7
+ <testsuites >
8
+ <testsuite name =" Test Suite" >
9
+ <directory >./tests</directory >
10
+ </testsuite >
11
+ </testsuites >
12
+ <coverage processUncoveredFiles =" true" >
13
+ <include >
14
+ <directory suffix =" .php" >./src</directory >
15
+ </include >
16
+ </coverage >
17
17
</phpunit >
Original file line number Diff line number Diff line change
1
+ sonar.projectName =Complex Heart Criteria
2
+ sonar.projectKey =ComplexHeart_php-criteria
3
+ sonar.organization =complexheart
4
+ sonar.language =php
5
+ sonar.sources =./src
6
+ sonar.tests =./tests
7
+ sonar.inclusions =./src/**
8
+ sonar.exclusions =./tests/**
9
+ sonar.php.coverage.reportPaths =coverage.xml
10
+ sonar.php.tests.reportPaths =phpunit.xml
You can’t perform that action at this time.
0 commit comments