diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000000000000000000000000000000000..c1322dc7b86272fd3a7329b71de7685535b5bcbc --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = false +insert_final_newline = false \ No newline at end of file diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..28396e167041de8e2e31a3d5c244f4f88007aa91 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +/.editorconfig export-ignore +/.gitattributes export-ignore +/.gitignore export-ignore +/.gitlab-ci.yml +/ecs.php export-ignore diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..b5cc4f0efac8e9aaf121afca13499d01f3b099c0 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,57 @@ +stages: + - check + - build + - test + +default: + image: php:latest + cache: + paths: + - vendor/ + before_script: + # Install git + - apt update -yqq + - apt install git libzip-dev -yqq + - docker-php-ext-install zip + + # Install composer + - curl -sS https://getcomposer.org/installer | php + + # Install all project dependencies + - php composer.phar install + +job:check:php: + stage: check + when: on_success + only: + - main + - merge_requests + before_script: + # Remplace le before_script par défaut ! + - curl -o /usr/local/bin/parallel-lint -fsL https://github.com/php-parallel-lint/PHP-Parallel-Lint/releases/latest/download/parallel-lint.phar + script: + # Vérifier rapidement les fichiers + - php /usr/local/bin/parallel-lint --exclude .git --exclude vendor . + +job:build: + stage: build + only: + - main + - merge_requests + script: + # Auditer + - php composer.phar audit + +job:test:ecs: + stage: test + when: on_success + only: + - main + - merge_requests + script: + - php -d display_errors=0 vendor/bin/ecs check --output-format=gitlab > ecs-quality-report.json + artifacts: + paths: + - ecs-quality-report.json + reports: + codequality: ecs-quality-report.json