This repository has been archived by the owner on Jul 28, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add static code analysis through GitHub actions
- Loading branch information
Showing
97 changed files
with
470 additions
and
677 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
on: [push, pull_request] | ||
|
||
name: Lint | ||
|
||
jobs: | ||
php-cs-fixer: | ||
name: PHP-CS-Fixer | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: actions/checkout@v2 | ||
|
||
- name: "Run PHP-CS-Fixer" | ||
uses: docker://oskarstark/php-cs-fixer-ga:2.16.1 | ||
with: | ||
args: --ansi --verbose --diff --dry-run | ||
|
||
composer-normalize: | ||
name: composer-normalize | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: actions/checkout@v2 | ||
|
||
- name: "Run composer-normalize" | ||
uses: docker://localheinz/composer-normalize-action:0.5.2 | ||
with: | ||
args: --dry-run | ||
|
||
yaml-files: | ||
name: YAML files | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: actions/checkout@v2 | ||
|
||
- name: "Install Ruby 2.6" | ||
uses: actions/setup-ruby@v1 | ||
with: | ||
ruby-version: '2.6' | ||
|
||
- run: gem install yaml-lint | ||
|
||
- name: "Linting..." | ||
run: make lint-yaml | ||
|
||
xml-files: | ||
name: XML files | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: actions/checkout@v2 | ||
|
||
- run: sudo apt-get update && sudo apt-get install libxml2-utils | ||
|
||
- name: "Linting..." | ||
run: make lint-xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
on: [push, pull_request] | ||
name: Quality assurance | ||
jobs: | ||
phpstan: | ||
name: PHPStan | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: PHPStan | ||
uses: "docker://oskarstark/phpstan-ga" | ||
env: | ||
CHECK_PLATFORM_REQUIREMENTS: false | ||
REQUIRE_DEV: true | ||
with: | ||
args: analyse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,68 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<project name="sonata-sandbox" default="initialize-project" basedir="."> | ||
<target name="initialize-project"> | ||
<!-- TODO: check for existence of app/config/parameters.yml --> | ||
|
||
<property name="app.uploadsDir" value="./public/uploads/media" /> | ||
<property name="app.console" value="bin/console" /> | ||
|
||
<property name="app.uploadsDir" value="./public/uploads/media"/> | ||
<property name="app.console" value="bin/console"/> | ||
<if> | ||
<os family="windows" /> | ||
<then><property name="app.console" value="bin\console.bat"/></then> | ||
<else><property name="app.console" value="bin/console" /></else> | ||
<os family="windows"/> | ||
<then> | ||
<property name="app.console" value="bin\console.bat"/> | ||
</then> | ||
<else> | ||
<property name="app.console" value="bin/console"/> | ||
</else> | ||
</if> | ||
|
||
<echo msg="Preparing ${app.uploadsDir} folder" /> | ||
<delete dir="${app.uploadsDir}" includeemptydirs="true" failonerror="false" /> | ||
<mkdir dir="${app.uploadsDir}" /> | ||
|
||
<echo msg="Removing any existing cache" /> | ||
<echo msg="Preparing ${app.uploadsDir} folder"/> | ||
<delete dir="${app.uploadsDir}" includeemptydirs="true" failonerror="false"/> | ||
<mkdir dir="${app.uploadsDir}"/> | ||
<echo msg="Removing any existing cache"/> | ||
<foreach param="dir" absparam="path" target="delete-dir"> | ||
<fileset dir="./var/cache"> | ||
<type type="dir" /> | ||
<depth max="0" min="0" /> | ||
<type type="dir"/> | ||
<depth max="0" min="0"/> | ||
</fileset> | ||
</foreach> | ||
|
||
<echo msg="Warming up cache for production environment" /> <!-- TODO: Is this even needed? --> | ||
<echo msg="Warming up cache for production environment"/> | ||
<!-- TODO: Is this even needed? --> | ||
<SymfonyConsole console="${app.console}" command="cache:clear" checkReturn="true"> | ||
<arg name="env" value="prod" /> | ||
<arg name="no-warmup" /> | ||
<arg name="env" value="prod"/> | ||
<arg name="no-warmup"/> | ||
</SymfonyConsole> | ||
|
||
<echo msg="Preparing database" /> | ||
<echo msg="Preparing database"/> | ||
<SymfonyConsole console="${app.console}" command="doctrine:database:drop" checkReturn="true"> | ||
<arg name="force" /> | ||
<arg name="if-exists" /> | ||
<arg name="force"/> | ||
<arg name="if-exists"/> | ||
<!-- TODO: Fallback to doctrine:schema:drop in case user doesn't have permissions to drop/create databases? --> | ||
</SymfonyConsole> | ||
<SymfonyConsole console="${app.console}" command="doctrine:database:create" checkReturn="true" /> | ||
<SymfonyConsole console="${app.console}" command="doctrine:database:create" checkReturn="true"/> | ||
<SymfonyConsole console="${app.console}" command="doctrine:schema:update" checkReturn="true"> | ||
<arg name="force" /> | ||
<arg name="dump-sql" /> | ||
<arg name="force"/> | ||
<arg name="dump-sql"/> | ||
</SymfonyConsole> | ||
<SymfonyConsole console="${app.console}" command="doctrine:fixtures:load" checkReturn="true"> | ||
<!--<arg name="verbose" />--> | ||
<arg name="no-interaction" /> | ||
<!--<arg name="verbose"/>--> | ||
<arg name="no-interaction"/> | ||
</SymfonyConsole> | ||
|
||
<echo msg="Preparing sonata news and page bundles" /> | ||
<SymfonyConsole console="${app.console}" command="sonata:news:sync-comments-count" checkReturn="true" /> | ||
<echo msg="Preparing sonata news and page bundles"/> | ||
<SymfonyConsole console="${app.console}" command="sonata:news:sync-comments-count" checkReturn="true"/> | ||
<SymfonyConsole console="${app.console}" command="sonata:page:update-core-routes" checkReturn="true"> | ||
<arg name="site" value="all" /> | ||
<arg name="site" value="all"/> | ||
</SymfonyConsole> | ||
<SymfonyConsole console="${app.console}" command="sonata:page:create-snapshots" checkReturn="true"> | ||
<arg name="site" value="all" /> | ||
<arg name="site" value="all"/> | ||
</SymfonyConsole> | ||
|
||
<echo msg="Preparing ACLs" /> | ||
<SymfonyConsole console="${app.console}" command="sonata:admin:setup-acl" checkReturn="true" /> | ||
<SymfonyConsole console="${app.console}" command="sonata:admin:generate-object-acl" checkReturn="true" /> | ||
|
||
<echo msg="Preparing ACLs"/> | ||
<SymfonyConsole console="${app.console}" command="sonata:admin:setup-acl" checkReturn="true"/> | ||
<SymfonyConsole console="${app.console}" command="sonata:admin:generate-object-acl" checkReturn="true"/> | ||
<!-- TODO: check for existence of yarn|npm --> | ||
<echo msg="Generating assets" /> | ||
<SymfonyConsole console="${app.console}" command="assets:install" checkReturn="true" /> | ||
<echo msg="Generating assets"/> | ||
<SymfonyConsole console="${app.console}" command="assets:install" checkReturn="true"/> | ||
<!-- | ||
<SymfonyConsole console="yarn" command="encore dev" checkReturn="true" /> | ||
<SymfonyConsole console="yarn" command="encore dev" checkReturn="true"/> | ||
--> | ||
</target> | ||
|
||
<target name="delete-dir" hidden="true"> | ||
<delete dir="${path}" includeemptydirs="true" failonerror="true" /> | ||
<delete dir="${path}" includeemptydirs="true" failonerror="true"/> | ||
</target> | ||
</project> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.