-
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.
Merge pull request #2 from koencaerels/development
Development to master with QA check.
- Loading branch information
Showing
306 changed files
with
25,551 additions
and
6,945 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
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 |
---|---|---|
@@ -0,0 +1,99 @@ | ||
name: PHP Build QA and Test | ||
|
||
on: | ||
push: | ||
branches: [ "master", "development" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: shivammathur/setup-php@2cb9b829437ee246e9b3cac53555a39208ca6d28 | ||
with: | ||
php-version: '8.2' | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Copy .env.test.local | ||
run: php -r "file_exists('.env.test.local') || copy('.env.test', '.env.test.local');" | ||
|
||
- name: Copy .env | ||
run: php -r "file_exists('.env') || copy('.env.test', '.env');" | ||
|
||
## —— Composer ——————————————————————————————————————————————————————————— | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate --strict | ||
|
||
- 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 | ||
run: composer install --prefer-dist --no-progress | ||
|
||
## —— Database & cache —————————————————————————————————————————————————— | ||
|
||
- name: Create Database | ||
run: | | ||
touch var/data.db | ||
- name: Create cache directory | ||
run: | | ||
chmod 777 ./bin/console | ||
mkdir -p var/cache | ||
chmod 777 var/cache | ||
./bin/console cache:clear | ||
## —— PHP QA ——————————————————————————————————————————————————————————— | ||
|
||
- name: QA CS | ||
run: ./vendor/bin/php-cs-fixer check | ||
|
||
- name: QA STAN | ||
run: ./vendor/bin/phpstan analyse -c phpstan.neon application | ||
|
||
- name: QA Lint Container | ||
run: ./bin/console lint:container | ||
|
||
- name: QA Lint Twig | ||
run: ./bin/console lint:twig | ||
|
||
- name: QA PSALM | ||
run: ./vendor/bin/psalm | ||
|
||
## —— Yarn ———————————————————————————————————————————————————————————— | ||
|
||
- name: Nodejs install | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '21' | ||
|
||
- run: yarn install | ||
|
||
- name: Yarn build | ||
run: yarn run encore production | ||
|
||
## —— Frontend MemberModule —————————————————————————————————————————— | ||
|
||
- name: Build Member Module Application | ||
run: | | ||
cd frontends/member_module/ | ||
npm install | ||
npm run build-only | ||
## —— Testing ———————————————————————————————————————————————————————————— | ||
# - name: Execute tests (Unit & Integration Tests) via PestPHP | ||
# run: ./vendor/bin/pest |
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
35 changes: 35 additions & 0 deletions
35
application/YoshiKan/Application/Command/Common/EmailValidator.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 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Yoshi-Kan software. | ||
* | ||
* (c) Koen Caerels | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\YoshiKan\Application\Command\Common; | ||
|
||
use Symfony\Component\Validator\Constraints\Email; | ||
use Symfony\Component\Validator\Validation; | ||
|
||
class EmailValidator | ||
{ | ||
public static function isValid(string $email): bool | ||
{ | ||
if (0 == mb_strlen(trim($email))) { | ||
return false; | ||
} | ||
$validator = Validation::createValidator(); | ||
$errors = $validator->validate($email, [ | ||
new Email([ | ||
'message' => 'The email address is not valid.', | ||
]), | ||
]); | ||
|
||
return 0 === count($errors); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
application/YoshiKan/Application/Command/Common/SubscriptionItemsFactory.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
Oops, something went wrong.