Skip to content
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

Develope #9

Merged
merged 5 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 150 additions & 0 deletions .github/workflows/codestyle-and-unittest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
name: Codestyle and Unittest
on:
push:
branches:
- '*'
- '!master'
paths:
- "**.php"
pull_request:

jobs:
phplint:
name: PHP Lint
runs-on: ubuntu-20.04

steps:
- uses: actions/[email protected]

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
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

- name: Run PHP Linter
run: composer run-script phplint

phpstan:
name: PHP Stan
runs-on: ubuntu-20.04

steps:
- uses: actions/[email protected]

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
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

- name: Run PHP Stan
run: composer run-script phpstan

phpcs:
name: PHP CodeSniffer
runs-on: ubuntu-20.04

steps:
- uses: actions/[email protected]

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
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

- name: Run PHP Codesniffer
run: composer run-script phpcs

phpunit:
name: PHP Unit Test
needs:
- phplint
- phpstan
- phpcs
runs-on: ubuntu-20.04

steps:
- uses: actions/[email protected]

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
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

- name: Run PHP Unit Test
run: composer run-script unittest

# phpfunctional:
# name: PHP Functional Test
# needs:
# - phplint
# - phpstan
# - phpcs
# runs-on: ubuntu-20.04

# steps:
# - uses: actions/[email protected]

# - name: Install PHP with extensions.
# uses: shivammathur/setup-php@v2
# with:
# php-version: 8.3
# extensions: pdo, pdo_sqlite
# ini-values: date.timezone='UTC'

# - name: Validate composer.json and composer.lock
# run: composer validate --strict

# - name: Cache Composer packages
# id: composer-cache
# uses: actions/cache@v4
# 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

# - name: Run PHP Unit Test
# run: composer run-script functionaltest
31 changes: 0 additions & 31 deletions .github/workflows/phpcs.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/phplint.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/phpstan.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/phpunit.yml

This file was deleted.

3 changes: 2 additions & 1 deletion config/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Psr\Container\ContainerInterface;
use Stormannsgal\App\Handler\Account\ListAllAccountsHandler;
use Stormannsgal\App\Handler\PingHandler;
use Stormannsgal\Core\Config\RouteName;

/**
* FastRoute route configuration
Expand Down Expand Up @@ -40,6 +41,6 @@
*/

return static function (Application $app, MiddlewareFactory $factory, ContainerInterface $container): void {
$app->get('/api/ping', PingHandler::class, PingHandler::class);
$app->get('/api/ping', PingHandler::class, RouteName::HANDLER_PING);
$app->get('/api/account/list/all', ListAllAccountsHandler::class, ListAllAccountsHandler::class);
};
Loading
Loading