-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
49 changed files
with
654 additions
and
89 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,55 @@ | ||
|
||
name: "Coding Standards" | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "*" | ||
push: | ||
branches: | ||
- "*" | ||
|
||
jobs: | ||
coding-standards: | ||
name: "Coding Standards" | ||
runs-on: ${{ matrix.operating-system }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php-version: | ||
- "8.3" | ||
- "8.4" | ||
operating-system: [ubuntu-latest] | ||
composer-versions: | ||
- lowest | ||
- highest | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: "actions/checkout@v4" | ||
|
||
- name: "Install PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
coverage: "xdebug" | ||
php-version: "#{{ matrix.php-version }}" | ||
|
||
- name: "Install dependencies with Composer" | ||
uses: "ramsey/composer-install@v3" | ||
with: | ||
dependency-versions: "${{ matrix.composer-versions}}" | ||
- name: "Run PHPCS" | ||
run: | | ||
composer run test-phpcs | ||
- name: "Run rector" | ||
run: | | ||
composer run test-rector | ||
- name: "Run phpstan" | ||
run: | | ||
composer run phpstan | ||
- name: "Run phpunit" | ||
run: | | ||
composer run phpunit |
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,3 +1,9 @@ | ||
vendor/ | ||
composer.lock | ||
phpunit.xml | ||
phpunit.xml | ||
.php-cs-fixer.php | ||
.php-cs-fixer.cache | ||
.phpunit.result.cache | ||
tests/coverage | ||
!tests/coverage/.gitkeep | ||
.phpunit.cache |
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,24 @@ | ||
<?php | ||
|
||
/** | ||
* @see https://cs.symfony.com/doc/rules/index.html | ||
*/ | ||
$finder = PhpCsFixer\Finder::create() | ||
->in(__DIR__.'/src') | ||
->in(__DIR__.'/tests') | ||
; | ||
|
||
return (new PhpCsFixer\Config('typesense-bundle')) | ||
->setRules([ | ||
'@Symfony' => true, | ||
'array_syntax' => ['syntax' => 'short'], | ||
'concat_space' => ['spacing' => 'none'], | ||
'phpdoc_align' => ['align' => 'vertical'], | ||
'yoda_style' => false, // Disable Yoda conditions for readability | ||
'no_unused_imports' => true, | ||
'ordered_imports' => ['sort_algorithm' => 'alpha'], | ||
'single_line_throw' => false, | ||
]) | ||
->setLineEnding(PHP_EOL) | ||
->setFinder($finder) | ||
; |
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,6 +1,17 @@ | ||
FROM php:8.2-cli | ||
COPY --from=composer /usr/bin/composer /usr/bin/composer | ||
RUN apt-get update && apt-get install -y git unzip && rm -Rf /var/lib/apt/lists/* | ||
|
||
COPY --from=composer /usr/bin/composer /usr/bin/composer | ||
RUN mkdir -p /.composer/cache/ && chown -R 1000:1000 /.composer/cache/ | ||
USER 1000:1000 | ||
|
||
ENV XDEBUG_MODE=off | ||
COPY --from=ghcr.io/mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ | ||
RUN install-php-extensions xdebug | ||
RUN echo ' \n\ | ||
[xdebug] \n\ | ||
xdebug.enable=1 \n\ | ||
xdebug.idekey=PHPSTORM \n\ | ||
xdebug.client_host=host.docker.internal\n ' >> /usr/local/etc/php/conf.d/xdebug.ini | ||
|
||
USER www-data | ||
USER 1000:1000 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,39 @@ | ||
set shell := ["docker", "compose", "run", "-it", "--user=1000", "--rm", "php", "/usr/bin/composer"] | ||
composer *args: | ||
{{args}} | ||
set shell := ["docker", "compose", "run", "--entrypoint", "/bin/sh", "-it", "--user=1000", "--rm", "php", "-c"] | ||
composer *args="": | ||
/usr/bin/composer {{args}} | ||
|
||
sh *args="": | ||
sh {{args}} | ||
|
||
php *args="": | ||
php {{args}} | ||
|
||
install: | ||
install | ||
composer install | ||
|
||
tests: | ||
test | ||
update: | ||
update | ||
composer run test | ||
|
||
update *args="": | ||
composer update {{args}} | ||
|
||
lint: | ||
lint | ||
composer run lint | ||
|
||
rector: | ||
rector | ||
rector | ||
|
||
test-phpcs: | ||
composer run test-phpcs | ||
|
||
phpcs: | ||
composer run phpcs | ||
|
||
phpunit *args="": | ||
env XDEBUG_MODE=coverage composer run phpunit -- {{args}} | ||
|
||
phpunit-xdebug *args="": | ||
composer phpunit-xdebug -- {{args}} | ||
|
||
phpstan *args="": | ||
composer phpstan -- {{args}} |
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,17 @@ | ||
parameters: | ||
tipsOfTheDay: false | ||
level: max | ||
paths: | ||
- src/ | ||
- tests/ | ||
ignoreErrors: | ||
- '#(.*)no value type specified in iterable type array#' | ||
- | ||
identifier: 'method.notFound' | ||
path: src/BibliotecaTypesenseBundle.php | ||
- | ||
identifier: 'method.nonObject' | ||
path: src/BibliotecaTypesenseBundle.php | ||
- | ||
identifier: 'argument.type' | ||
path: src/BibliotecaTypesenseBundle.php |
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,35 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- http://phpunit.de/manual/4.1/en/appendixes.configuration.html --> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd" bootstrap="./tests/bootstrap.php" backupGlobals="false" colors="true" cacheDirectory=".phpunit.cache"> | ||
<testsuites> | ||
<testsuite name="TypesenseBundle"> | ||
<directory>tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<coverage pathCoverage="false" | ||
ignoreDeprecatedCodeUnits="true" | ||
disableCodeCoverageIgnore="true"> | ||
<report> | ||
<html outputDirectory="tests/coverage/html-coverage" lowUpperBound="50" highLowerBound="90"/> | ||
<text outputFile="tests/coverage/coverage.txt" showUncoveredFiles="false" showOnlySummary="true"/> | ||
</report> | ||
|
||
</coverage> | ||
<php> | ||
<env name="SYMFONY_DEPRECATIONS_HELPER" value="ignoreFile=./tests/baseline-ignore"/> | ||
</php> | ||
|
||
<logging> | ||
<junit outputFile="tests/coverage/junit.xml"/> | ||
<testdoxHtml outputFile="tests/coverage/testdox.html"/> | ||
<testdoxText outputFile="tests/coverage/testdox.txt"/> | ||
</logging> | ||
<source> | ||
<exclude> | ||
<directory suffix=".php">vendor</directory> | ||
</exclude> | ||
<include> | ||
<directory suffix=".php">src</directory> | ||
</include> | ||
</source> | ||
</phpunit> |
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.