This repository has been archived by the owner on Aug 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from smartbooster/1_init_bundle
#1 Init dev bundle
- Loading branch information
Showing
9 changed files
with
154 additions
and
4 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,40 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- "master" | ||
|
||
jobs: | ||
build_test_lastest: | ||
runs-on: ubuntu-latest | ||
name: Build and test on php-fpm:${{ matrix.php }}-builder | ||
container: smartbooster/php-fpm:${{ matrix.php }}-builder | ||
strategy: | ||
matrix: | ||
php: [ 7.4 ] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Check PHP Version | ||
run: php -v | ||
|
||
# —— Composer 🧙️ ————————————————————————————————————————————————————————— | ||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Cache composer dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Install | ||
run: composer install --prefer-dist | ||
|
||
- name: Qualimetry | ||
run: make qa |
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,5 @@ | ||
/vendor/ | ||
composer.lock | ||
/phpmetrics/ | ||
coverage.* | ||
.php_cs.cache |
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,61 @@ | ||
.DEFAULT_GOAL := help | ||
.PHONY: help | ||
help: | ||
@grep -E '(^[a-zA-Z_-]+:.*?##.*$$)|(^##)' ./Makefile | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[34m%-20s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[34m##/[33m/' | ||
|
||
## | ||
## Docker | ||
## ------- | ||
.PHONY: up | ||
up: ## Start the project stack with docker | ||
docker-compose up | ||
|
||
.PHONY: down | ||
down: ## Kill the project stack with docker | ||
docker-compose down | ||
|
||
.PHONY: ps | ||
ps: ## List containers from project | ||
docker-compose ps | ||
|
||
.PHONY: ssh | ||
ssh: ## Access to the php container in interactive mode | ||
docker exec -it --user=dev smartbooster-parameterbundle-php bash | ||
|
||
## | ||
## Qualimetry | ||
## ------- | ||
|
||
.PHONY: cs checkstyle | ||
cs: checkstyle | ||
checkstyle: ## PHP Checkstyle | ||
vendor/bin/phpcs --extensions=php -n --standard=PSR12 --report=full src tests | ||
|
||
.PHONY: cb code-beautifier | ||
cb: code-beautifier | ||
code-beautifier: ## Code beautifier (Checkstyle fixer) | ||
vendor/bin/phpcbf --extensions=php --standard=PSR12 src tests | ||
|
||
.PHONY: lint-php | ||
lint-php: ## Linter PHP | ||
find src -type f -name "*.php" -exec php -l {} \; | ||
|
||
.PHONY: composer-validate | ||
composer-validate: ## Validate composer.json and composer.lock | ||
composer validate composer.json | ||
|
||
.PHONY: cpd | ||
cpd: ## Copy paste detector | ||
vendor/bin/phpcpd --fuzzy src | ||
|
||
.PHONY: metrics | ||
metrics: ## Build static analysis from the php in src. Repports available in ./phpmetrics/index.html | ||
vendor/bin/phpmetrics --report-html=phpmetrics src | ||
|
||
.PHONY: phpstan | ||
phpstan: ## Launch PHP Static Analysis | ||
vendor/bin/phpstan analyse src --level=6 | ||
|
||
.PHONY: qa qualimetry | ||
qa: qualimetry ## Launch all qualimetry rules | ||
qualimetry: checkstyle lint-php cpd composer-validate metrics phpstan |
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,31 @@ | ||
# SMARTBOOSTER - Parameter bundle | ||
|
||
[![Latest Stable Version](http://poser.pugx.org/smartbooster/parameter-bundle/v)](https://packagist.org/packages/smartbooster/parameter-bundle) | ||
[![Latest Unstable Version](http://poser.pugx.org/smartbooster/parameter-bundle/v/unstable)](https://packagist.org/packages/smartbooster/parameter-bundle) | ||
[![Total Downloads](http://poser.pugx.org/smartbooster/parameter-bundle/downloads)](https://packagist.org/packages/smartbooster/parameter-bundle) | ||
[![License](http://poser.pugx.org/smartbooster/parameter-bundle/license)](https://packagist.org/packages/smartbooster/parameter-bundle) | ||
|
||
![CI workflow](https://github.com/smartbooster/parameter-bundle/actions/workflows/ci.yml/badge.svg) | ||
|
||
## Installation | ||
|
||
### Add the bundle as dependency with Composer | ||
|
||
``` bash | ||
composer require smartbooster/parameter-bundle | ||
``` | ||
|
||
## What's inside ! | ||
|
||
Provide an easy way to administrate your app parameters through each environment with the following tools : | ||
|
||
- A **configuration template to define all parameters** that need to exist in your application with their default value | ||
- A **Command to use on CD to generate missing parameters** | ||
- A **Parameter Entity** to store your parameters in database | ||
- An **Admin** to easily edit the value of your parameters and more data related to them | ||
|
||
## Contributing | ||
|
||
Pull requests are welcome. | ||
|
||
Thanks to [everyone who has contributed](https://github.com/smartbooster/parameter-bundle/contributors) already. |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: '3' | ||
|
||
services: | ||
php: | ||
container_name: smartbooster-parameterbundle-php | ||
image: smartbooster/php-fpm:builder | ||
ports: | ||
- "9000:9000" | ||
volumes: | ||
- ./:/var/www |
Empty file.
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,3 @@ | ||
<?php | ||
|
||
# Temporary PHP file to have phpcpd working on CI, to delete on next commit with PHP Code |
Empty file.