Skip to content

Commit 2297861

Browse files
pk27734reinschaapricklambrechts
authored
introduce SonarQube cloud (#44)
* Added Sonarcloud to CI + config file * Copied in the sonar action coz this repo is public * Use new action template * Test with broadening scope * Added extra error-format * Revert implementation of template * Switched to dual run phpstan * replace sonarcloud with sonarqube cloud (scan action) replace https://github.com/SonarSource/sonarcloud-github-action with https://github.com/SonarSource/sonarqube-scan-action * Update .github/workflows/ci.yml --------- Co-authored-by: Rein Schaap <[email protected]> Co-authored-by: Rick Lambrechts <[email protected]>
1 parent 40821d6 commit 2297861

File tree

2 files changed

+33
-4
lines changed

2 files changed

+33
-4
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
name: Continuous Integration
22

3+
34
on:
5+
workflow_dispatch:
46
push:
5-
branches: [ main ]
7+
branches: [ main ]
8+
tags: [ v* ]
69
pull_request:
7-
branches: [ main ]
810

911
jobs:
1012
run-tests:
@@ -59,14 +61,21 @@ jobs:
5961
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
6062
6163
- name: Execute tests (Unit and Feature)
62-
run: vendor/bin/phpunit
64+
run: vendor/bin/phpunit --log-junit=reports/report-phpunit.xml --coverage-clover=reports/coverage-phpunit.xml
6365

6466
- name: Static analysis with PHPStan
65-
run: vendor/bin/phpstan analyse
67+
run: |
68+
vendor/bin/phpstan analyse --error-format=github
69+
vendor/bin/phpstan analyse --error-format=json > reports/phpstan.json
6670
6771
- name: Static analysis with Psalm
6872
if: "${{ matrix.experimental == false }}"
6973
run: vendor/bin/psalm
7074

7175
- name: Coding style PSR12 Check
7276
run: vendor/bin/phpcs
77+
78+
- name: 'Run SonarQube cloud scanner'
79+
uses: minvws/nl-irealisatie-generic-pipelines/.github/actions/sonarcloud@main
80+
with:
81+
sonar-token: ${{ secrets.SONAR_TOKEN }}

sonar-project.properties

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Project info
2+
sonar.organization=vws
3+
sonar.projectKey=nl-rdo-openid-connect-php-laravel
4+
5+
# Info links shown in SonarCloud
6+
sonar.links.homepage=https://github.com/minvws/nl-rdo-openid-connect-php-laravel
7+
8+
# Encoding and language specific properties
9+
sonar.sourceEncoding=UTF-8
10+
11+
# Analysis scoping
12+
sonar.sources=src,config,routes
13+
sonar.tests=tests
14+
15+
# Code coverage
16+
sonar.php.tests.reportPath=reports/report-phpunit.xml
17+
sonar.php.coverage.reportPaths=reports/coverage-phpunit.xml
18+
19+
# Additional reports
20+
sonar.php.phpstan.reportPaths=reports/phpstan.json

0 commit comments

Comments
 (0)