Update workflow

This commit is contained in:
Matteo Gheza 2021-12-24 18:23:06 +01:00
parent 1a84107686
commit 17a0126dbc
3 changed files with 8 additions and 79 deletions

View File

@ -52,56 +52,6 @@ jobs:
run: |
composer install --prefer-dist --no-progress
code_quality:
if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
defaults:
run:
working-directory: ./server
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.4']
name: Code Quality ${{ matrix.php-versions }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl
ini-values: post_max_size=256M, log_errors = on, error_reporting = 32767, error_log = /tmp/php.log
coverage: xdebug, pcov
- name: Setup NodeJS
uses: actions/setup-node@v2
with:
node-version: '12'
- name: WebPack Setup
run: |
cd resources
npm install
./node_modules/.bin/webpack --version
./node_modules/.bin/webpack --config webpack.prod.js
ls dist
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: PhpCS report
run: ./vendor/bin/phpcs . --extensions="php,js" --ignore="resources/dist,resources/node_modules,vendor,sw.js" --config-set ignore_errors_on_exit 1 --config-set ignore_warnings_on_exit 1 --report=json > /tmp/phpcs_report.json
- uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: phpcs_report_${{ github.run_id }}
path: /tmp/phpcs_report.json
staging_deployment:
if: github.event.ref == 'refs/heads/staging'
needs: tests
@ -115,7 +65,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: 8.0
extensions: mbstring, intl
ini-values: post_max_size=256M, log_errors = on, error_reporting = 32767, error_log = /tmp/php.log
coverage: xdebug, pcov
@ -123,7 +73,7 @@ jobs:
- name: Setup NodeJS
uses: actions/setup-node@v2
with:
node-version: '12'
node-version: '14'
- name: Deploy
run: |
@ -161,7 +111,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: 8.0
extensions: mbstring, intl
ini-values: post_max_size=256M, log_errors = on, error_reporting = 32767, error_log = /tmp/php.log
coverage: xdebug, pcov
@ -169,7 +119,7 @@ jobs:
- name: Setup NodeJS
uses: actions/setup-node@v2
with:
node-version: '12'
node-version: '14'
- name: Deploy
run: |

View File

@ -1,8 +0,0 @@
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/backend/dist-frontend/$1 -f
RewriteRule ^(.*)$ dist-frontend/$1 [L]
RewriteCond %{THE_REQUEST} \s/backend/dist-frontend/ [NC,OR]
RewriteCond $1 !^dist-frontend/
RewriteRule ^(.*)$ router.php [L]

View File

@ -1,22 +1,12 @@
<?php
$baseConfig = [
'local' => 'server',
'local' => 'backend',
'ignore' => '
.git*
.github
.vscode
*.json
!resources/dist/assets-manifest.json
resources/src
resources/node_modules
resources/webpack*
resources/images/logo.png
resources/images/owner.png
cypress
debug_storage/exception*
debug_storage/*.log
debug_storage/*.json
config.old.php
config.php
*tests*
@ -31,7 +21,6 @@ $baseConfig = [
*.md
*.rst
*.txt
!resources/dist/*.LICENSE.txt
!robots.txt
*.sh
*editorconfig
@ -46,17 +35,15 @@ $baseConfig = [
*phpstan*
*phpunit*
vendor/nikic/fast-route/test
vendor/twig/twig/src/Node/Expression/Test
vendor/twig/twig/src/Test
*.lock
*.zip
',
'allowDelete' => false,
'before' => [
'local: cd server && composer update --no-dev -o'
'local: cd backend && composer update --no-dev -o'
],
'after' => [
'local: cd server && composer install'
'local: cd backend && composer install'
],
'filePermissions' => "0644",
'dirPermissions' => "0755"
@ -77,7 +64,7 @@ foreach ($remotes as $key => $value) {
$config[$key]["before"] = [];
} else {
$env = isset($config[$key]["sentry_env"]) ? $config[$key]["sentry_env"] : "prod";
$config[$key]["before"][] = "local: cd server/resources && npm i && npm run prod -- --env sentryEnvironment=".$env;
$config[$key]["before"][] = "local: cd frontend && npm ci && npm run build";
}
if(isset($value["after"]) && $value["after"] === false){
$config[$key]["after"] = [];