Update workflow
This commit is contained in:
parent
1a84107686
commit
17a0126dbc
|
@ -52,56 +52,6 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
composer install --prefer-dist --no-progress
|
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:
|
staging_deployment:
|
||||||
if: github.event.ref == 'refs/heads/staging'
|
if: github.event.ref == 'refs/heads/staging'
|
||||||
needs: tests
|
needs: tests
|
||||||
|
@ -115,7 +65,7 @@ jobs:
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: 7.4
|
php-version: 8.0
|
||||||
extensions: mbstring, intl
|
extensions: mbstring, intl
|
||||||
ini-values: post_max_size=256M, log_errors = on, error_reporting = 32767, error_log = /tmp/php.log
|
ini-values: post_max_size=256M, log_errors = on, error_reporting = 32767, error_log = /tmp/php.log
|
||||||
coverage: xdebug, pcov
|
coverage: xdebug, pcov
|
||||||
|
@ -123,7 +73,7 @@ jobs:
|
||||||
- name: Setup NodeJS
|
- name: Setup NodeJS
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: '12'
|
node-version: '14'
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
run: |
|
run: |
|
||||||
|
@ -161,7 +111,7 @@ jobs:
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: 7.4
|
php-version: 8.0
|
||||||
extensions: mbstring, intl
|
extensions: mbstring, intl
|
||||||
ini-values: post_max_size=256M, log_errors = on, error_reporting = 32767, error_log = /tmp/php.log
|
ini-values: post_max_size=256M, log_errors = on, error_reporting = 32767, error_log = /tmp/php.log
|
||||||
coverage: xdebug, pcov
|
coverage: xdebug, pcov
|
||||||
|
@ -169,7 +119,7 @@ jobs:
|
||||||
- name: Setup NodeJS
|
- name: Setup NodeJS
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: '12'
|
node-version: '14'
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -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]
|
|
|
@ -1,22 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$baseConfig = [
|
$baseConfig = [
|
||||||
'local' => 'server',
|
'local' => 'backend',
|
||||||
'ignore' => '
|
'ignore' => '
|
||||||
.git*
|
.git*
|
||||||
.github
|
.github
|
||||||
.vscode
|
.vscode
|
||||||
*.json
|
*.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.old.php
|
||||||
config.php
|
config.php
|
||||||
*tests*
|
*tests*
|
||||||
|
@ -31,7 +21,6 @@ $baseConfig = [
|
||||||
*.md
|
*.md
|
||||||
*.rst
|
*.rst
|
||||||
*.txt
|
*.txt
|
||||||
!resources/dist/*.LICENSE.txt
|
|
||||||
!robots.txt
|
!robots.txt
|
||||||
*.sh
|
*.sh
|
||||||
*editorconfig
|
*editorconfig
|
||||||
|
@ -46,17 +35,15 @@ $baseConfig = [
|
||||||
*phpstan*
|
*phpstan*
|
||||||
*phpunit*
|
*phpunit*
|
||||||
vendor/nikic/fast-route/test
|
vendor/nikic/fast-route/test
|
||||||
vendor/twig/twig/src/Node/Expression/Test
|
|
||||||
vendor/twig/twig/src/Test
|
|
||||||
*.lock
|
*.lock
|
||||||
*.zip
|
*.zip
|
||||||
',
|
',
|
||||||
'allowDelete' => false,
|
'allowDelete' => false,
|
||||||
'before' => [
|
'before' => [
|
||||||
'local: cd server && composer update --no-dev -o'
|
'local: cd backend && composer update --no-dev -o'
|
||||||
],
|
],
|
||||||
'after' => [
|
'after' => [
|
||||||
'local: cd server && composer install'
|
'local: cd backend && composer install'
|
||||||
],
|
],
|
||||||
'filePermissions' => "0644",
|
'filePermissions' => "0644",
|
||||||
'dirPermissions' => "0755"
|
'dirPermissions' => "0755"
|
||||||
|
@ -77,7 +64,7 @@ foreach ($remotes as $key => $value) {
|
||||||
$config[$key]["before"] = [];
|
$config[$key]["before"] = [];
|
||||||
} else {
|
} else {
|
||||||
$env = isset($config[$key]["sentry_env"]) ? $config[$key]["sentry_env"] : "prod";
|
$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){
|
if(isset($value["after"]) && $value["after"] === false){
|
||||||
$config[$key]["after"] = [];
|
$config[$key]["after"] = [];
|
||||||
|
|
Loading…
Reference in New Issue