Skip to content

Commit

Permalink
Merge pull request #2 from koencaerels/development
Browse files Browse the repository at this point in the history
Development to master with QA check.
  • Loading branch information
koencaerels authored Jan 16, 2024
2 parents 31fe50c + 820d6c2 commit ee5593f
Show file tree
Hide file tree
Showing 306 changed files with 25,551 additions and 6,945 deletions.
13 changes: 13 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,16 @@ LOCK_DSN=flock
###< symfony/lock ###

UPLOAD_FOLDER=uploads

# Mollie settings
MOLLIE_API_KEY=
MOLLIE_PARTNER_ID=
MOLLIE_PROFILE_ID=
MOLLIE_REDIRECT_BASE_URL=

# Resend.com API key (for two-factor authentication)
RESEND_API_KEY=

###> sentry/sentry-symfony ###
SENTRY_DSN=
###< sentry/sentry-symfony ###
2 changes: 1 addition & 1 deletion .env.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# define your env variables for the test env here
APP_VERSION=0.0.1
APP_ENV=test
APP_ENV=dev
KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999
Expand Down
99 changes: 99 additions & 0 deletions .github/workflows/php_build_and_qa_test.yml
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
15 changes: 15 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@
$finder = (new PhpCsFixer\Finder())
->in(__DIR__)
->exclude('var')
->exclude('vendor')
->exclude('node_modules')
->exclude('public')
->exclude('uploads')
->exclude('frontends')
->exclude('migrations')
->exclude('docker')
->exclude('config')
->exclude('assets')
->exclude('.git')
->exclude('.github')
->exclude('_temp')
->exclude('cypress')
->exclude('translations')
->exclude('bin')
;

return (new PhpCsFixer\Config())
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2023 Yoshi-Kan by Koen Caerels
Copyright (c) 2023-2024 Yoshi-Kan by Koen Caerels

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
35 changes: 35 additions & 0 deletions application/YoshiKan/Application/Command/Common/EmailValidator.php
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);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
<?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 App\YoshiKan\Domain\Model\Member\Federation;
Expand Down
Loading

0 comments on commit ee5593f

Please sign in to comment.