Skip to content

Commit bfcf068

Browse files
committed
Added Sonarcloud to CI + config file
1 parent 675b2fa commit bfcf068

File tree

2 files changed

+31
-4
lines changed

2 files changed

+31
-4
lines changed

.github/workflows/ci.yml

Lines changed: 11 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,19 @@ jobs:
5961
run: 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: vendor/bin/phpstan analyse --error-format=json > reports/phpstan.json
6668

6769
- name: Static analysis with Psalm
6870
if: "${{ matrix.experimental == false }}"
6971
run: vendor/bin/psalm
7072

7173
- name: Coding style PSR12 Check
7274
run: vendor/bin/phpcs
75+
76+
- name: Run SonarCloud scanner
77+
uses: minvws/nl-irealisatie-generic-pipelines/.github/actions/sonarcloud@main
78+
with:
79+
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
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)