Skip to content

Commit

Permalink
Update master
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Eichhorn committed Apr 24, 2024
2 parents d5938b6 + 1f8b85b commit 6ef5cb2
Show file tree
Hide file tree
Showing 234 changed files with 2,346 additions and 1,934 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/c_template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI

on:
workflow_call:
secrets:
GH_TOKEN:
required: true
GH_PAT:
required: true
CODECOV_TOKEN:
required: true

jobs:
codestyle-tests:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'NO_CI')"
steps:
- name: Checkout Repository
uses: actions/checkout@main
with:
fetch-depth: 0
submodules: recursive
token: ${{ secrets.GH_TOKEN }}
- name: Checkout Build Repository
uses: actions/checkout@main
with:
fetch-depth: 1
ref: develop
repository: Karaka-Management/Build
path: Build
- name: Copy config file
run: |
cp ./Build/Config/.clang-format ./.clang-format
- name: Lint Code Base
uses: super-linter/[email protected]
env:
VALIDATE_ALL_CODEBASE: false
VALIDATE_CLANG_FORMAT : true
DEFAULT_BRANCH: develop
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
74 changes: 74 additions & 0 deletions .github/workflows/js_template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: CI

on:
workflow_call:
secrets:
GH_TOKEN:
required: true
GH_PAT:
required: true
CODECOV_TOKEN:
required: true

jobs:
codestyle-tests:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'NO_CI')"
steps:
- name: Checkout Repository
uses: actions/checkout@main
with:
fetch-depth: 1
- name: Checkout Build Repository
uses: actions/checkout@main
with:
fetch-depth: 1
ref: develop
repository: Karaka-Management/Build
path: Build
- name: Install NPM
uses: actions/setup-node@v3
with:
node-version: '14'
cache: 'npm'
- run: npm install
- name: eslint
run: npx eslint ./ -c Build/Config/.eslintrc.json --fix
- name: Check for modified files
if: always()
id: git-format-check
run: echo "modified=$(if git diff-index -G --quiet HEAD --; then echo "false"; else echo "true"; fi)" >> $GITHUB_OUTPUT
- name: Push changes
if: steps.git-format-check.outputs.modified == 'true'
run: |
git config --global user.name 'Formatter Bot'
git config --global user.email '[email protected]'
git remote set-url origin https://x-access-token:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}
git commit -am "Automated formatting changes (NO_CI)"
git push
code-tests:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'NO_CI')"
steps:
- name: Checkout Repository
uses: actions/checkout@main
with:
fetch-depth: 1
- name: Checkout Build Repository
uses: actions/checkout@main
with:
fetch-depth: 1
ref: develop
repository: Karaka-Management/Build
path: Build
- name: Install NPM
uses: actions/setup-node@v3
with:
node-version: '14'
cache: 'npm'
- run: npm install
- name: jasmine
run: |
chmod +x Build/Config/jasmine_build.sh
Build/Config/jasmine_build.sh
npx jasmine --config=Build/Config/jasmine.json
34 changes: 13 additions & 21 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: '12.x'
node-version: '14'
- name: Cache dependencies
id: npm-cache
run: |
Expand Down Expand Up @@ -114,6 +114,17 @@ jobs:
run: composer install
- name: phpunit
run: vendor/bin/phpunit --coverage-clover tests/coverage.xml --configuration tests/phpunit_no_coverage.xml
- name: Install NPM
uses: actions/setup-node@v3
with:
node-version: '14'
cache: 'npm'
- run: npm install
- name: jasmine
run: |
cd jsOMS
Build/Config/jasmine_build.sh
npx jasmine --config=Build/Config/jasmine.json
cpp-tests:
if: "!contains(github.event.head_commit.message, 'NO_CI')"
strategy:
Expand Down Expand Up @@ -220,25 +231,6 @@ jobs:
- run: npm install
- name: eslint
run: npx eslint ./jsOMS -c Build/Config/.eslintrc.json
# linting:
# runs-on: ubuntu-latest
# if: "!contains(github.event.head_commit.message, 'NO_CI')"
# strategy:
# fail-fast: false
# max-parallel: 3
# steps:
# - name: Checkout Repository
# uses: actions/checkout@main
# with:
# fetch-depth: 0
# submodules: recursive
# token: ${{ secrets.GH_PAT }}
# - name: Lint Code Base
# uses: github/super-linter/slim@v4
# env:
# VALIDATE_ALL_CODEBASE: false
# DEFAULT_BRANCH: develop
# GITHUB_TOKEN: ${{ secrets.GH_PAT }}
custom:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'NO_CI')"
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/php_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
max-parallel: 3
matrix:
php-versions: ['8.1']
php-versions: ['8.3']
steps:
- name: Checkout Repository
uses: actions/checkout@main
Expand All @@ -44,7 +44,7 @@ jobs:
fail-fast: false
max-parallel: 3
matrix:
php-versions: ['8.1']
php-versions: ['8.3']
steps:
- name: Checkout Repository
uses: actions/checkout@main
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
fail-fast: false
max-parallel: 3
matrix:
php-versions: ['8.1']
php-versions: ['8.3']
steps:
- name: Checkout Repository
uses: actions/checkout@main
Expand Down Expand Up @@ -176,7 +176,7 @@ jobs:
fail-fast: false
max-parallel: 3
matrix:
php-versions: ['8.1']
php-versions: ['8.3']
steps:
- name: Checkout Repository
uses: actions/checkout@main
Expand Down Expand Up @@ -225,7 +225,7 @@ jobs:
fail-fast: false
max-parallel: 3
matrix:
php-versions: ['8.1']
php-versions: ['8.3']
steps:
- name: Checkout Repository
uses: actions/checkout@main
Expand Down Expand Up @@ -268,7 +268,7 @@ jobs:
fail-fast: false
max-parallel: 3
matrix:
php-versions: ['8.1']
php-versions: ['8.3']
steps:
- name: Checkout Repository
uses: actions/checkout@main
Expand Down
10 changes: 3 additions & 7 deletions Cli/CliApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Jingga
*
* PHP Version 8.1
* PHP Version 8.2
*
* @package Cli
* @copyright Dennis Eichhorn
Expand Down Expand Up @@ -395,15 +395,11 @@ private function create403Response(CliResponse $response, View $pageView) : void
*/
private function createDefaultPageView(CliRequest $request, CliResponse $response, CliView $pageView) : void
{
/** @var \Modules\Organization\Models\Unit[] $unit */
$unit = UnitMapper::getAll()->execute();
$pageView->setOrganizations($unit);
$pageView->organizations = UnitMapper::getAll()->executeGetArray();

/** @var \Modules\Profile\Models\Profile $profile */
$profile = ProfileMapper::get()
$pageView->profile = ProfileMapper::get()
->where('account', $request->header->account)
->execute();
$pageView->profile = $profile;

$pageView->setTemplate('/Cli/index');
}
Expand Down
21 changes: 3 additions & 18 deletions Cli/CliView.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Jingga
*
* PHP Version 8.1
* PHP Version 8.2
*
* @package Cli
* @copyright Dennis Eichhorn
Expand Down Expand Up @@ -54,7 +54,7 @@ class CliView extends View
* @var Unit[]
* @since 1.0.0
*/
protected array $organizations = [];
public array $organizations = [];

/**
* Constructor
Expand All @@ -65,25 +65,10 @@ class CliView extends View
*
* @since 1.0.0
*/
public function __construct(L11nManager $l11n = null, RequestAbstract $request = null, ResponseAbstract $response = null)
public function __construct(?L11nManager $l11n = null, ?RequestAbstract $request = null, ?ResponseAbstract $response = null)
{
parent::__construct($l11n, $request, $response);

$this->profile = new NullProfile();
}

/**
* Set organizations
*
* @param Unit[] $organizations Organizations
*
* @return void
*
* @since 1.0.0
* @codeCoverageIgnore
*/
public function setOrganizations(array $organizations) : void
{
$this->organizations = $organizations;
}
}
2 changes: 1 addition & 1 deletion Cli/Error/lang/de.lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Jingga
*
* PHP Version 8.1
* PHP Version 8.2
*
* @package Cli
* @copyright Dennis Eichhorn
Expand Down
2 changes: 1 addition & 1 deletion Cli/Error/lang/en.lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Jingga
*
* PHP Version 8.1
* PHP Version 8.2
*
* @package Cli
* @copyright Dennis Eichhorn
Expand Down
5 changes: 0 additions & 5 deletions Cli/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,4 @@
1 => '\Modules\Media\Controller\CliController:runEncryptionChangeFromHook',
],
],
'/.*/' => [
'callback' => [
0 => '\Modules\Workflow\Controller\CliController:runWorkflowFromHook',
],
],
];
28 changes: 0 additions & 28 deletions Cli/Routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,4 @@
'verb' => 16,
],
],
'^.*/workflow/instance( .*$|$)' => [
0 => [
'dest' => '\Modules\Workflow\Controller\CliController:cliWorkflowInstanceCreate',
'verb' => 16,
],
],
'^/billing/bill/purchase/parse( .*$|$)' => [
0 => [
'dest' => '\Modules\Billing\Controller\CliController:cliParseSupplierBill',
'verb' => 16,
],
],
'^/purchase/order/suggestion/create( .*$|$)' => [
0 => [
'dest' => '\Modules\Purchase\Controller\CliController:cliGenerateOrderSuggestion',
'verb' => 16,
],
],
'^.*/orw/check -i all*$' => [
0 => [
'dest' => '\Modules\OnlineResourceWatcher\Controller\ApiController:apiCheckResources',
'permission' => [
'module' => 'OnlineResourceWatcher',
'type' => 4,
'state' => 1,
],
],
],
];
4 changes: 1 addition & 3 deletions Cli/index.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Jingga
*
* PHP Version 8.1
* PHP Version 8.2
*
* @package Template
* @copyright Dennis Eichhorn
Expand All @@ -12,8 +12,6 @@
*/
declare(strict_types=1);

use phpOMS\Contract\RenderableInterface;

$dispatch = $this->getData('dispatch') ?? [];

echo \PHP_EOL;
Expand Down
2 changes: 1 addition & 1 deletion Cli/lang/en.lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Jingga
*
* PHP Version 8.1
* PHP Version 8.2
*
* @package Cli
* @copyright Dennis Eichhorn
Expand Down
File renamed without changes.
Loading

0 comments on commit 6ef5cb2

Please sign in to comment.