Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RequestMapper] Added SonarCloud checks, refactor GitHub actions
- Loading branch information
1 parent
0e654d8
commit d5b2ee1
Showing
22 changed files
with
164 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
- 'releases/**' | ||
paths-ignore: | ||
- '**/*.md' | ||
- '**/*.gitignore' | ||
- '**/*.gitattributes' | ||
|
||
pull_request: | ||
types: | ||
- published | ||
- created | ||
- edited | ||
- opened | ||
- synchronize | ||
- reopened | ||
paths-ignore: | ||
- '**/*.md' | ||
- '**/*.gitignore' | ||
- '**/*.gitattributes' | ||
|
||
jobs: | ||
build: | ||
name: PHP | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
php: | ||
- "8.1" | ||
- "8.2" | ||
include: | ||
- php-versions: ["8.1", "8.2"] | ||
- composer-options: "--ignore-platform-reqs" | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: "${{ matrix.php }}" | ||
extensions: mbstring, intl | ||
coverage: xdebug | ||
tools: pecl, phpunit, composer | ||
ini-values: post_max_size=256M | ||
|
||
- name: Setup composer | ||
uses: ramsey/composer-install@v1 | ||
with: | ||
composer-options: "${{ matrix.composer-options }}" | ||
|
||
- name: Validate composer files | ||
run: composer validate | ||
|
||
- name: Cache composer packages | ||
id: composer-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-php- | ||
- name: Install dependencies | ||
if: steps.composer-cache.outputs.cache-hit != 'true' | ||
run: composer update --prefer-dist --no-progress | ||
|
||
- name: Setup tests directories | ||
run: mkdir -p build/logs | ||
|
||
- name: Execute unit tests | ||
run: ./vendor/bin/phpunit --colors=always --configuration phpunit.xml.dist --coverage-cobertura tests-cobertura.xml --coverage-clover tests-coverage.xml --log-junit tests-execution.xml | ||
|
||
- name: Prepare coverages and logs | ||
run: cp tests-coverage.xml build/logs/clover.xml && cp tests-cobertura.xml build/logs/cobertura.xml && cp tests-execution.xml build/logs/junit.xml | ||
|
||
- name: Push to Coveralls | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COVERALLS_PARALLEL: true | ||
COVERALLS_FLAG_NAME: php-${{ matrix.php-versions }} | ||
run: | | ||
composer global require php-coveralls/php-coveralls | ||
php-coveralls -v | ||
- name: SonarCloud scan | ||
uses: SonarSource/sonarcloud-github-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
with: | ||
projectBaseDir: ${{ github.workspace }} | ||
|
||
finish: | ||
needs: [ build ] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Coveralls Finished | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
parallel-finished: true |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,25 @@ | ||
RequestMapper Component | ||
============================= | ||
![Workflow Build Status](https://github.com/fractalzombie/frzb-request-mapper/actions/workflows/ci.yml/badge.svg?event=push) | ||
![Workflow Build Status](https://github.com/fractalzombie/frzb-request-mapper/actions/workflows/build.yml/badge.svg?event=push) | ||
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/fractalzombie/frzb-request-mapper/badges/quality-score.png?b=main)](https://scrutinizer-ci.com/g/fractalzombie/frzb-request-mapper/?branch=main) | ||
[![Code Intelligence Status](https://scrutinizer-ci.com/g/fractalzombie/frzb-request-mapper/badges/code-intelligence.svg?b=main)](https://scrutinizer-ci.com/code-intelligence) | ||
[![Build Status](https://scrutinizer-ci.com/g/fractalzombie/frzb-request-mapper/badges/build.png?b=main)](https://scrutinizer-ci.com/g/fractalzombie/frzb-request-mapper/build-status/main) | ||
[![Coverage Status](https://coveralls.io/repos/github/fractalzombie/frzb-request-mapper/badge.svg?branch=main)](https://coveralls.io/github/fractalzombie/frzb-request-mapper?branch=main) | ||
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=fractalzombie_frzb-request-mapper&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=fractalzombie_frzb-request-mapper) | ||
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=fractalzombie_frzb-request-mapper&metric=bugs)](https://sonarcloud.io/summary/new_code?id=fractalzombie_frzb-request-mapper) | ||
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=fractalzombie_frzb-request-mapper&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=fractalzombie_frzb-request-mapper) | ||
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=fractalzombie_frzb-request-mapper&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=fractalzombie_frzb-request-mapper) | ||
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=fractalzombie_frzb-request-mapper&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=fractalzombie_frzb-request-mapper) | ||
[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=fractalzombie_frzb-request-mapper&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=fractalzombie_frzb-request-mapper) | ||
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=fractalzombie_frzb-request-mapper&metric=coverage)](https://sonarcloud.io/summary/new_code?id=fractalzombie_frzb-request-mapper) | ||
[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=fractalzombie_frzb-request-mapper&metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=fractalzombie_frzb-request-mapper) | ||
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=fractalzombie_frzb-request-mapper&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=fractalzombie_frzb-request-mapper) | ||
[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=fractalzombie_frzb-request-mapper&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=fractalzombie_frzb-request-mapper) | ||
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=fractalzombie_frzb-request-mapper&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=fractalzombie_frzb-request-mapper) | ||
|
||
The RequestMapper component allows you to serialize JSON request to Request class and validate it. | ||
|
||
Resources | ||
--------- | ||
|
||
* [Documentation](https://github.com/fractalzombie/frzb-request-mapper/blob/main/Documentation/USAGE.MD) | ||
* [License](https://github.com/fractalzombie/frzb-request-mapper/blob/main/LICENSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.