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

[PW-6785] - Coverage report for SonarCloud #1665

Merged
merged 23 commits into from
Aug 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ccb5603
[PW-6785] - Coverage report for SonarCloud
candemiralp Aug 12, 2022
9d581a2
[PW-6785] - Coverage report for SonarCloud
candemiralp Aug 12, 2022
c8cd0f2
[PW-6785] - Coverage report for SonarCloud
candemiralp Aug 12, 2022
af4172a
[PW-6785] - Coverage report for SonarCloud
candemiralp Aug 12, 2022
dea4110
[PW-6785] - Coverage report for SonarCloud
candemiralp Aug 12, 2022
13d68d9
[PW-6785] - Coverage report for SonarCloud
candemiralp Aug 12, 2022
3402e91
[PW-6785] - Coverage report for SonarCloud
candemiralp Aug 12, 2022
0bd0bcf
[PW-6785] - Coverage report for SonarCloud
candemiralp Aug 12, 2022
8e8f2e4
[PW-6785] - Coverage report for SonarCloud
candemiralp Aug 12, 2022
f371f34
[PW-6785] - Refactor phpunit.xml for configuration and main.yml for p…
candemiralp Aug 15, 2022
9d9b8aa
[PW-6785] - Add sonar-project.properties file
candemiralp Aug 15, 2022
6a297f6
[PW-6785] - Remove sonar analysis from CI
candemiralp Aug 15, 2022
00ee285
Merge branch 'develop' into PW-6785
candemiralp Aug 15, 2022
410bddb
[PW-6785] - Remove unnecessary dependencies
candemiralp Aug 15, 2022
bd74dd3
[PW-6785] - Coverage test function
candemiralp Aug 15, 2022
dfd5c93
[PW-6785] - Enable CI based sonar analysis
candemiralp Aug 15, 2022
d9ea7bf
[PW-6785] - Code formatting
candemiralp Aug 15, 2022
6f6ca5d
[PW-6785] - Temporarily disable PHP8.1 matrix
candemiralp Aug 15, 2022
effcf6b
[PW-6785] - Change allowed list for scan
candemiralp Aug 15, 2022
10a735d
[PW-6785] - Change allowed list for scan
candemiralp Aug 15, 2022
e7d1f63
[PW-6785] - Exclude vendor directory from sonar analysis
candemiralp Aug 15, 2022
9483d5e
[PW-6785] - Remove the filter for sonar analysis and include all the …
candemiralp Aug 15, 2022
8941768
[PW-6785] - Revert commits 6f6ca5d and bd74dd3
candemiralp Aug 15, 2022
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
17 changes: 15 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer:v1,
tools: composer:v1

- name: Test plugin installation
run: |
echo "{\"http-basic\":{\"repo.magento.com\":{\"username\":\"${MAGENTO_USERNAME}\",\"password\":\"${MAGENTO_PASSWORD}\"}}}" > auth.json
Expand All @@ -25,7 +26,19 @@ jobs:
CI: true
MAGENTO_USERNAME: ${{ secrets.MAGENTO_USERNAME }}
MAGENTO_PASSWORD: ${{ secrets.MAGENTO_PASSWORD }}

- name: Code Sniffer
run: vendor/bin/phpcs --extensions=php,phtml --error-severity=10 --ignore-annotations

- name: Run PHPUnit
run: vendor/bin/phpunit Test/Unit
run: vendor/bin/phpunit --coverage-clover=build/clover.xml --log-junit=build/tests-log.xml -c Test/phpunit.xml Test/Unit

- name: Fix code coverage paths
run: sed -i "s;`pwd`/;;g" build/*.xml

- name: SonarCloud Scan
if: ${{ env.SONAR_TOKEN }}
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
22 changes: 21 additions & 1 deletion Test/phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,32 @@
-->
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/6.3/phpunit.xsd"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="./bootstrap.php"
colors="true"
>
<php>
<ini name="display_errors" value="On"/>
<ini name="memory_limit" value="-1"/>
<ini name="max_execution_time" value="0"/>
<ini name="display_startup_errors" value="On"/>
<ini name="error_reporting" value="E_ALL"/>
<ini name="date.timezone" value="UTC"/>
<server name="SHELL_VERBOSITY" value="-1"/>
</php>

<testsuites>
<testsuite name="default">
<directory>.</directory>
</testsuite>
</testsuites>

<coverage processUncoveredFiles="false">
<include>
<directory suffix=".php">../.</directory>
</include>
<exclude>
<directory>../vendor</directory>
</exclude>
</coverage>
</phpunit>
6 changes: 6 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sonar.organization=adyen
sonar.projectKey=Adyen_adyen-magento2
sonar.sources=.
sonar.exclusions=vendor/**/*
sonar.php.coverage.reportPaths=build/clover.xml
sonar.php.tests.reportPath=build/tests-log.xml