-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2543e95
commit 5b12559
Showing
11 changed files
with
2,027 additions
and
38 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,21 @@ | ||
name: Lint | ||
on: [push] | ||
jobs: | ||
lint: | ||
name: PHP Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.2 | ||
|
||
- name: Cache Composer dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/composer-cache | ||
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} | ||
|
||
- uses: actions/checkout@master | ||
- name: test | ||
run: make test |
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 +1,6 @@ | ||
/vendor/ | ||
.idea | ||
.phpunit.result.cache | ||
.phpunit.cache | ||
.vscode | ||
index.php |
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,16 +1,40 @@ | ||
.DEFAULT_GOAL := help | ||
|
||
# ----------------------------------- | ||
# Variables | ||
# ----------------------------------- | ||
is_docker := $(shell docker info > /dev/null 2>&1 && echo 1) | ||
user := $(shell id -u) | ||
group := $(shell id -g) | ||
|
||
ifeq ($(is_docker), 1) | ||
php := USER_ID=$(user) GROUP_ID=$(group) docker-compose run --rm --no-deps php | ||
composer := $(php) composer | ||
else | ||
php := php | ||
composer := composer | ||
endif | ||
|
||
# ----------------------------------- | ||
# Recipes | ||
# ----------------------------------- | ||
.PHONY: help | ||
help: ## affiche cet aide | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
||
.PHONY: lint | ||
lint: vendor/autoload.php ## affiche les erreurs de formatage de code | ||
php vendor/bin/ecs | ||
php vendor/bin/phpstan | ||
$(php) vendor/bin/ecs | ||
$(php) vendor/bin/phpstan | ||
|
||
.PHONY: test | ||
test: vendor/autoload.php ## lance les tests | ||
$(php) vendor/bin/phpunit | ||
|
||
.PHONY: lint-fix | ||
lint-fix: vendor/autoload.php ## corrige les erreurs de formatage de code | ||
php vendor/bin/ecs --fix | ||
$(php) vendor/bin/ecs --fix | ||
|
||
vendor/autoload.php: composer.lock # installe les dépendances PHP | ||
composer update | ||
composer dump-autoload | ||
$(composer) update | ||
$(composer) dump-autoload |
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
Oops, something went wrong.