Skip to content

Commit

Permalink
Cosmetic changes (#34)
Browse files Browse the repository at this point in the history
* cosmetic: update phpunit config file

* cosmetic: php version check for different phpunit config

* cosmetic: update workflow

* cosmetic: removed sonarqube badges

* cosmetic: disabled sonarqube in workflow
  • Loading branch information
mysiar authored Nov 10, 2022
1 parent 54cb211 commit 06c6a1f
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 32 deletions.
35 changes: 24 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
branches:
- master
- dev
- main

jobs:
build:
Expand All @@ -21,28 +22,40 @@ jobs:
php-version: ${{ matrix.php }}
coverage: xdebug
tools: composer

- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install Composer dependencies
run: composer install

- name: Prepare PHPUnit config file for PHP < 8
run: cp phpunit.xml.dist8 phpunit.xml.dist
if: "matrix.php < 8"

- name: PHPUnit tests (PHP ${{ matrix.php }})
run: php${{ matrix.php }} ./vendor/bin/phpunit --testdox --verbose --stop-on-failure

- uses: symfonycorp/security-checker-action@v3

- name: Coding standard (PHP ${{ matrix.php }})
run: php${{ matrix.php }} ./vendor/bin/ecs check src tests

- name: Code coverage
run: php${{ matrix.php }} -d xdebug.mode=coverage ./vendor/bin/phpunit --coverage-clover=var/coverage.xml

- name: Fix code coverage paths
run: sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' var/coverage.xml
- name: Analyze with SonarQube
uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
# If you wish to fail your job when the Quality Gate is red, uncomment the
# following lines. This would typically be used to fail a deployment.
# - uses: sonarsource/sonarqube-quality-gate-action@master
# timeout-minutes: 5
# env:
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

# - name: Analyze with SonarQube
# uses: sonarsource/sonarqube-scan-action@master
# env:
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
# # If you wish to fail your job when the Quality Gate is red, uncomment the
# # following lines. This would typically be used to fail a deployment.
# # - uses: sonarsource/sonarqube-quality-gate-action@master
# # timeout-minutes: 5
# # env:
# # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
11 changes: 0 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,6 @@
[![PHP Version Require](http://poser.pugx.org/mysiar/omnipay-przelewy24v1/require/php)](https://packagist.org/packages/mysiar/omnipay-przelewy24v1)
[![GitHub stars](https://img.shields.io/github/stars/mysiar-org/omnipay-przelewy24v1)](https://github.com/mysiar-org/omnipay-przelewy24v1/stargazers)

[![Coverage](https://sq.mysiar.dev/api/project_badges/measure?project=mysiar-org_omnipay-przelewy24v1_AYKYVbX_XdtDi-mnE6gc&metric=coverage&token=e3ee022dee8869d296c924b840b66e0aefb86f62)](https://sq.mysiar.dev/dashboard?id=mysiar-org_omnipay-przelewy24v1_AYKYVbX_XdtDi-mnE6gc)
[![Maintainability Rating](https://sq.mysiar.dev/api/project_badges/measure?project=mysiar-org_omnipay-przelewy24v1_AYKYVbX_XdtDi-mnE6gc&metric=sqale_rating&token=e3ee022dee8869d296c924b840b66e0aefb86f62)](https://sq.mysiar.dev/dashboard?id=mysiar-org_omnipay-przelewy24v1_AYKYVbX_XdtDi-mnE6gc)
[![Quality Gate Status](https://sq.mysiar.dev/api/project_badges/measure?project=mysiar-org_omnipay-przelewy24v1_AYKYVbX_XdtDi-mnE6gc&metric=alert_status&token=e3ee022dee8869d296c924b840b66e0aefb86f62)](https://sq.mysiar.dev/dashboard?id=mysiar-org_omnipay-przelewy24v1_AYKYVbX_XdtDi-mnE6gc)
[![Reliability Rating](https://sq.mysiar.dev/api/project_badges/measure?project=mysiar-org_omnipay-przelewy24v1_AYKYVbX_XdtDi-mnE6gc&metric=reliability_rating&token=e3ee022dee8869d296c924b840b66e0aefb86f62)](https://sq.mysiar.dev/dashboard?id=mysiar-org_omnipay-przelewy24v1_AYKYVbX_XdtDi-mnE6gc)
[![Security Rating](https://sq.mysiar.dev/api/project_badges/measure?project=mysiar-org_omnipay-przelewy24v1_AYKYVbX_XdtDi-mnE6gc&metric=security_rating&token=e3ee022dee8869d296c924b840b66e0aefb86f62)](https://sq.mysiar.dev/dashboard?id=mysiar-org_omnipay-przelewy24v1_AYKYVbX_XdtDi-mnE6gc)
[![Bugs](https://sq.mysiar.dev/api/project_badges/measure?project=mysiar-org_omnipay-przelewy24v1_AYKYVbX_XdtDi-mnE6gc&metric=bugs&token=e3ee022dee8869d296c924b840b66e0aefb86f62)](https://sq.mysiar.dev/dashboard?id=mysiar-org_omnipay-przelewy24v1_AYKYVbX_XdtDi-mnE6gc)
[![Code Smells](https://sq.mysiar.dev/api/project_badges/measure?project=mysiar-org_omnipay-przelewy24v1_AYKYVbX_XdtDi-mnE6gc&metric=code_smells&token=e3ee022dee8869d296c924b840b66e0aefb86f62)](https://sq.mysiar.dev/dashboard?id=mysiar-org_omnipay-przelewy24v1_AYKYVbX_XdtDi-mnE6gc)
[![Duplicated Lines (%)](https://sq.mysiar.dev/api/project_badges/measure?project=mysiar-org_omnipay-przelewy24v1_AYKYVbX_XdtDi-mnE6gc&metric=duplicated_lines_density&token=e3ee022dee8869d296c924b840b66e0aefb86f62)](https://sq.mysiar.dev/dashboard?id=mysiar-org_omnipay-przelewy24v1_AYKYVbX_XdtDi-mnE6gc)
[![Lines of Code](https://sq.mysiar.dev/api/project_badges/measure?project=mysiar-org_omnipay-przelewy24v1_AYKYVbX_XdtDi-mnE6gc&metric=ncloc&token=e3ee022dee8869d296c924b840b66e0aefb86f62)](https://sq.mysiar.dev/dashboard?id=mysiar-org_omnipay-przelewy24v1_AYKYVbX_XdtDi-mnE6gc)
[![Technical Debt](https://sq.mysiar.dev/api/project_badges/measure?project=mysiar-org_omnipay-przelewy24v1_AYKYVbX_XdtDi-mnE6gc&metric=sqale_index&token=e3ee022dee8869d296c924b840b66e0aefb86f62)](https://sq.mysiar.dev/dashboard?id=mysiar-org_omnipay-przelewy24v1_AYKYVbX_XdtDi-mnE6gc)
[![Vulnerabilities](https://sq.mysiar.dev/api/project_badges/measure?project=mysiar-org_omnipay-przelewy24v1_AYKYVbX_XdtDi-mnE6gc&metric=vulnerabilities&token=e3ee022dee8869d296c924b840b66e0aefb86f62)](https://sq.mysiar.dev/dashboard?id=mysiar-org_omnipay-przelewy24v1_AYKYVbX_XdtDi-mnE6gc)

## API endpoints implemented

Expand Down
14 changes: 5 additions & 9 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,15 @@
<include>
<directory>./src</directory>
</include>
<report>
<clover outputFile="var/coverage.xml"/>
<html outputDirectory="var/phpunit" lowUpperBound="50" highLowerBound="85"/>
</report>
</coverage>
<testsuites>
<testsuite name="Omnipay Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="var/phpunit" lowUpperBound="35" highLowerBound="70"/>
<log type="coverage-clover" target="var/coverage.xml"/>
</logging>

</phpunit>
27 changes: 27 additions & 0 deletions phpunit.xml.dist8
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.5/phpunit.xsd">
<testsuites>
<testsuite name="Omnipay Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="var/phpunit" lowUpperBound="35" highLowerBound="70"/>
<log type="coverage-clover" target="var/coverage.xml"/>
</logging>
</phpunit>
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sonar.projectKey=mysiar-org_omnipay-przelewy24v1_AYKYVbX_XdtDi-mnE6gc
sonar.sources=src/
sonar.tests=tests/
sonar.verbose=true
sonar.verbose=false
sonar.php.coverage.reportPaths=var/coverage.xml

0 comments on commit 06c6a1f

Please sign in to comment.