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

introduce SonarQube cloud #44

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
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
25 changes: 21 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: Continuous Integration


on:
workflow_dispatch:
push:
branches: [ main ]
branches: [ main ]
tags: [ v* ]
pull_request:
branches: [ main ]

jobs:
run-tests:
Expand Down Expand Up @@ -59,14 +61,29 @@ jobs:
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Execute tests (Unit and Feature)
run: vendor/bin/phpunit
run: vendor/bin/phpunit --log-junit=reports/report-phpunit.xml --coverage-clover=reports/coverage-phpunit.xml

- name: Static analysis with PHPStan
run: vendor/bin/phpstan analyse
run: |
vendor/bin/phpstan analyse --error-format=github
vendor/bin/phpstan analyse --error-format=json > reports/phpstan.json

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

- name: Coding style PSR12 Check
run: vendor/bin/phpcs

- name: 'Run SonarQube cloud scanner'
if: ${{contains(github.ref, '/pull/')}}
uses: SonarSource/sonarqube-scan-action@v5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: 'Run SonarQube cloud scanner'
if: ${{!contains(github.ref, '/pull/')}}
uses: SonarSource/sonarqube-scan-action@v5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: -Dsonar.branch.name=${{ github.ref_name }}
20 changes: 20 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Project info
sonar.organization=vws
sonar.projectKey=nl-rdo-openid-connect-php-laravel

# Info links shown in SonarCloud
sonar.links.homepage=https://github.com/minvws/nl-rdo-openid-connect-php-laravel

# Encoding and language specific properties
sonar.sourceEncoding=UTF-8

# Analysis scoping
sonar.sources=src,config,routes
sonar.tests=tests

# Code coverage
sonar.php.tests.reportPath=reports/report-phpunit.xml
sonar.php.coverage.reportPaths=reports/coverage-phpunit.xml

# Additional reports
sonar.php.phpstan.reportPaths=reports/phpstan.json
Loading