Skip to content

Commit

Permalink
Improve developer experience (#10)
Browse files Browse the repository at this point in the history
* chore: add makefile and Dockerfile
to be able to install dependencies and run tests

* chore: update travis configuration
to add a matrix and test with lowest and highest dependencies
  • Loading branch information
Pol-Valentin authored and qpautrat committed Jul 11, 2019
1 parent 8d9e28f commit 7af8716
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ php:
- '7.1'
- '7.2'

install: composer install
env:
matrix:
- PREFER_LOWEST="--prefer-lowest"
- PREFER_LOWEST=""

matrix:
allow_failures:
- env: PREFER_LOWEST="--prefer-lowest"

install:
composer update $PREFER_LOWEST

script: composer test
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM php:7.1-alpine

COPY --from=composer /usr/bin/composer /usr/bin/composer

WORKDIR /app
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.DEFAULT_GOAL:help

RUN?=docker run --rm --interactive --tty --volume ${PWD}:/app woohoolabs-yin-bundle

help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m * make %s\033[0m ## %s\n", $$1, $$2}'

build: ## Build image used to install dependencies and run tests
docker build --tag=woohoolabs-yin-bundle ${PWD}

install: ## Install dependencies with docker
$(RUN) composer install

test: ## Run phpspec tests
$(RUN) vendor/bin/phpspec run

0 comments on commit 7af8716

Please sign in to comment.