Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

De 55463 sonar qube integration #61

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
10 changes: 10 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,13 @@ jobs:
- name: Run phpunit
run: composer phpunit

- name: Run tests with coverage
run: composer test-with-coverage
if: matrix.php-version == '7.2' && matrix.composer-arg == 'install'

- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@master
if: matrix.php-version == '7.2' && matrix.composer-arg == 'install'
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: "https://sonar.nice.com"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
composer.lock
vendor
.phpunit.result.cache
coverage.xml
test-report.xml
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
"phpcs": "vendor/bin/phpcs --standard=BrandEmbassyCodingStandard src tests --ignore=tests/temp",
"phpcbf": "./vendor/bin/phpcbf --standard=BrandEmbassyCodingStandard src tests --ignore=tests/temp",
"phpstan": "./vendor/bin/phpstan analyse -c phpstan.neon src",
"phpunit": "./vendor/bin/phpunit tests --no-coverage"
"phpunit": "./vendor/bin/phpunit tests --no-coverage",
"test": "./vendor/bin/phpunit tests",
"test-with-coverage": "php -dxdebug.mode=coverage ./vendor/bin/phpunit tests --coverage-clover=coverage.xml --log-junit=test-report.xml"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
9 changes: 9 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
sonar.projectKey=com.nicedfo.slim-nette-extension
sonar.projectName=slim-nette-extension
sonar.language=PHP
sonar.sources=tests
sonar.tests=tests
sonar.exclusions=**/*Test.php
sonar.test.inclusions=**/*Test.php
sonar.php.coverage.reportPaths=coverage.xml
sonar.php.tests.reportPath=test-report.xml
Loading