diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0cf5b6b..643a23a 100755 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -131,6 +131,96 @@ jobs: env: CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}" run: "bash <(curl -s https://codecov.io/bash) -f tests/coverage.xml" + static-tests: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, 'NO_CI')" + strategy: + fail-fast: false + max-parallel: 3 + matrix: + php-versions: ['8.0'] + steps: + - name: Checkout Repository + uses: actions/checkout@master + with: + fetch-depth: 1 + submodules: recursive + token: ${{ secrets.GITHUB }} + - name: Checkout Build Repository + uses: actions/checkout@master + with: + fetch-depth: 1 + ref: develop + repository: Karaka/Build + path: Build + - name: Setup PHP, with composer and extensions + uses: shivammathur/setup-php@master + with: + php-version: ${{ matrix.php-versions }} + extensions: mbstring, gd, zip, dom, mysql, pgsql, sqlite, imap, bcmath, redis, memcached + ini-values: opcache.jit_buffer_size=256M, opcache.jit=1235, pcre.jit=1 + - name: Get Composer Cache Directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache dependencies + uses: actions/cache@v1 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + - name: Setup Composer + run: composer install + - name: phpstan + run: vendor/bin/phpstan analyse -a phpOMS/Autoloader.php --no-progress -l 9 -c Build/Config/phpstan.neon ./ + codestyle-tests: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, 'NO_CI')" + strategy: + fail-fast: false + max-parallel: 3 + matrix: + php-versions: ['8.0'] + steps: + - name: Checkout Repository + uses: actions/checkout@master + with: + fetch-depth: 1 + submodules: recursive + token: ${{ secrets.GITHUB }} + - name: Checkout Build Repository + uses: actions/checkout@master + with: + fetch-depth: 1 + ref: develop + repository: Karaka/Build + path: Build + - name: Setup PHP, with composer and extensions + uses: shivammathur/setup-php@master + with: + php-version: ${{ matrix.php-versions }} + extensions: mbstring, gd, zip, dom, mysql, pgsql, sqlite, imap, bcmath, redis, memcached + ini-values: opcache.jit_buffer_size=256M, opcache.jit=1235, pcre.jit=1 + - name: Get Composer Cache Directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache dependencies + uses: actions/cache@v1 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + - name: Setup Composer + run: composer install + - name: phpcs + run: vendor/bin/phpcs ./ --standard="Build/Config/phpcs.xml" -s --report=full + - 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 custom: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, 'NO_CI')" @@ -168,6 +258,11 @@ jobs: run: | if [[ $(find ./ -name "*tpl.php" | xargs grep -E '=\"[\#\$\%\^\&\*\(\)\\/\ ]*\"') -ne "" ]]; then exit 1; fi if [[ $(find ./ -name "*tpl.php" | xargs grep -P '(\)') -ne "" ]]; then exit 1; fi + if [[ $(find ./ -name "*tpl.php" | xargs grep -P '()') -ne "" ]]; then exit 1; fi + if [[ $(find ./ -name "*tpl.php" | xargs grep -P '()') -ne "" ]]; then exit 1; fi + if [[ $(find ./ -name "*tpl.php" | xargs grep -P '(style=)') -ne "" ]]; then exit 1; fi + if [[ $(find ./ -name "*tpl.php" | xargs grep -P '(value|title|alt|aria\-label)(=\")((?!\<\?).)*(>)') -ne "" ]]; then exit 1; fi + if [[ $(find ./ -name "*tpl.php" | xargs grep -P '(\|\|\|\)) -ne "" ]]; then exit 1; fi - name: Js strict run: if [[ $(grep -r -L "\"use strict\";" --include=*.js ./) -ne "" ]]; then exit 1; fi - name: Js inspection diff --git a/Admin/Install/Application/Shop/Application.php b/Admin/Install/Application/Shop/Application.php index db49b8c..b32f2c1 100755 --- a/Admin/Install/Application/Shop/Application.php +++ b/Admin/Install/Application/Shop/Application.php @@ -363,7 +363,6 @@ final class Application $head->addAsset(AssetType::JS, '../jsOMS/Utils/oLib.js'); $head->addAsset(AssetType::JS, '../jsOMS/UnhandledException.js'); $head->addAsset(AssetType::JS, '../Web/{APPNAME}/js/shop.js', ['type' => 'module']); - $head->addAsset(AssetType::JSLATE, '../Modules/Navigation/Controller.js', ['type' => 'module']); $script = ''; $response->header->set(