Skip to content

Commit 5cbecf3

Browse files
committed
Makefile
1 parent 5212e6b commit 5cbecf3

File tree

3 files changed

+43
-7
lines changed

3 files changed

+43
-7
lines changed

.travis.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ matrix:
99
- php: 7.3
1010
- php: 7.4
1111

12-
before_script:
13-
- composer install --dev
14-
- cp .env.dist .env
12+
install:
13+
- cp .env.dist .env
14+
- make dependencies
1515

16-
script: ./vendor/bin/phpunit
16+
script:
17+
- make test
18+
- make qa
19+
- make license
20+
- make changelog

Makefile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
.DEFAULT_GOAL:=help
2+
3+
.PHONY: dependencies
4+
dependencies:
5+
composer install --no-interaction --no-suggest --no-scripts --ansi
6+
7+
.PHONY: test
8+
test:
9+
vendor/bin/phpunit --testdox --exclude-group=none --colors=always
10+
11+
.PHONY: qa
12+
qa: php-cs-fixer phpstan
13+
14+
.PHONY: php-cs-fixer
15+
php-cs-fixer:
16+
vendor/bin/php-cs-fixer fix --no-interaction --allow-risky=yes --diff --verbose
17+
18+
PHONY: phpstan
19+
phpstan:
20+
vendor/bin/phpstan analyse --level=max app/ web/
21+
22+
.PHONY: changelog
23+
changelog:
24+
git log $$(git describe --abbrev=0 --tags)...HEAD --no-merges --pretty=format:"* [%h](http://github.com/${TRAVIS_REPO_SLUG}/commit/%H) %s (%cN)"
25+
26+
.PHONY: license
27+
license:
28+
vendor/bin/docheader check --no-interaction --ansi -vvv {app,test,web}
29+
30+
# Based on https://suva.sh/posts/well-documented-makefiles/
31+
help: ## Display this help
32+
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Read our blog post series about this repository at:
1616
Install the dependencies with composer:
1717

1818
```
19-
$ composer install
19+
make dependencies
2020
```
2121

2222
Configuration is determined based on environment variables. Copy `.env.dist` to `.env` and adjust where needed.
@@ -30,8 +30,8 @@ The environment variable `TOGGLE__ALLOWED_ORIGINS` should be valid JSON. This is
3030
We use PHPUnit, so to run the tests simply run:
3131

3232
```
33-
$ docker-compose up -d
34-
$ vendor/bin/phpunit
33+
docker-compose up -d
34+
make test
3535
```
3636

3737
## Running the app

0 commit comments

Comments
 (0)