-
-
Notifications
You must be signed in to change notification settings - Fork 1
Video #9 #18
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
Video #9 #18
Changes from all commits
fa89e09
6013498
e5186e9
f68ca7f
664a036
e93a385
fd564b8
3d44dfa
2d8e12f
f3f961f
383b89d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| name: REST API v6 CI | ||
| on: | ||
| push: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
| jobs: | ||
| sonarqube: | ||
| name: SonarQube | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
| - name: SonarQube Scan | ||
| uses: SonarSource/sonarqube-scan-action@v5 | ||
| env: | ||
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| /cache/ | ||
| /config/development/ | ||
| .composer | ||
| .bash_history | ||
| vendor |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| { | ||
| "name": "phalcon/rest-api", | ||
| "type": "library", | ||
| "description": "Sample REST API application implemented with Phalcon v6", | ||
| "keywords": [ | ||
| "phalcon", | ||
| "framework", | ||
| "sample app", | ||
| "rest-api", | ||
| "rest", | ||
| "api" | ||
| ], | ||
| "homepage": "https://phalcon.io", | ||
| "license": "MIT", | ||
| "authors": [ | ||
| { | ||
| "name": "Contributors", | ||
| "homepage": "https://github.com/phalcon/rest-api/graphs/contributors" | ||
| } | ||
| ], | ||
| "require": { | ||
| "php": ">=8.2", | ||
| "ext-json": "*", | ||
| "ext-mbstring": "*", | ||
| "robmorgan/phinx": "^0.16.10", | ||
| "vlucas/phpdotenv": "^5.6" | ||
| }, | ||
| "require-dev": { | ||
| "pds/composer-script-names": "^1.0", | ||
| "pds/skeleton": "*", | ||
| "phpstan/phpstan": "^2.1", | ||
| "phpunit/phpunit": "^10.5", | ||
| "squizlabs/php_codesniffer": "^3.13" | ||
| }, | ||
| "config": { | ||
| "preferred-install": "dist", | ||
| "sort-packages": true, | ||
| "optimize-autoloader": true | ||
| }, | ||
| "replace": { | ||
| "symfony/polyfill-php80": "*", | ||
niden marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "symfony/polyfill-php81": "*", | ||
| "symfony/polyfill-php82": "*", | ||
| "symfony/polyfill-ctype": "*", | ||
| "symfony/polyfill-mbstring": "*" | ||
| }, | ||
| "scripts": { | ||
| "analyze": "phpstan analyse -c phpstan.neon --memory-limit=512M", | ||
| "cs": "vendor/bin/phpcs --standard=phpcs.xml", | ||
| "cs-fix": "vendor/bin/phpcbf --standard=phpcs.xml", | ||
| "test-unit": "vendor/bin/phpunit -c phpunit.xml.dist --display-all-issues" | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <?xml version="1.0"?> | ||
| <ruleset name="Phalcon-REST-v6"> | ||
| <description>Phalcon REST API v6 Coding Standards</description> | ||
| <arg value="--colors"/> | ||
| <arg value="s"/> | ||
| <arg value="p"/> | ||
| <rule ref="PSR12"> | ||
| <exclude name="PSR2.Methods.MethodDeclaration.Underscore"/> | ||
| </rule> | ||
| <file>src</file> | ||
| <file>tests/Unit</file> | ||
| </ruleset> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| parameters: | ||
| level: max | ||
| paths: | ||
| - src |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| <?php | ||
|
|
||
| ini_set('xdebug.mode', 'coverage'); | ||
|
|
||
| error_reporting(E_ALL); | ||
|
|
||
| $autoloader = __DIR__ . '/vendor/autoload.php'; | ||
|
|
||
| if (! file_exists($autoloader)) { | ||
| echo "Composer autoloader not found: $autoloader" . PHP_EOL; | ||
| echo "Please issue 'composer install' and try again." . PHP_EOL; | ||
| exit(1); | ||
| } | ||
|
|
||
| require_once $autoloader; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| <?xml version="1.0"?> | ||
| <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" | ||
| bootstrap="./phpunit.php" | ||
| cacheDirectory="tests/_output/.phpunit.result.cache" | ||
| colors="true" | ||
| processIsolation="true" | ||
| > | ||
| <testsuites> | ||
| <testsuite name="unit and mysql tests"> | ||
| <directory>./tests/Unit/</directory> | ||
| </testsuite> | ||
| </testsuites> | ||
| <source> | ||
| <include> | ||
| <directory suffix=".php">./src</directory> | ||
| </include> | ||
| </source> | ||
| </phpunit> |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,14 @@ | ||||||||||
| sonar.projectKey=niden-code_phalcon-rest-api-v6 | ||||||||||
| sonar.organization=niden | ||||||||||
|
Comment on lines
+1
to
+2
|
||||||||||
| sonar.projectKey=niden-code_phalcon-rest-api-v6 | |
| sonar.organization=niden | |
| sonar.projectKey=phalcon-rest-api-v6 | |
| sonar.organization=phalcon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow uses SonarSource/sonarqube-scan-action@v5 but lacks the SONAR_HOST_URL environment variable. For SonarQube Server, this variable is required. If using SonarCloud (as indicated by sonar-project.properties), this is acceptable, but consider adding a comment clarifying this is for SonarCloud to avoid confusion.