Skip to content

Commit 41f890e

Browse files
Separate step for linting in travis matrix. Readded phpdocumentor
1 parent 84612d5 commit 41f890e

File tree

7 files changed

+49
-9
lines changed

7 files changed

+49
-9
lines changed

.travis.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ env:
2020
- TARGET="71"
2121
- TARGET="72"
2222
- TARGET="73"
23+
- TARGET="Lint"
2324

2425
before_install:
2526
# check running "docker engine" and "docker-compose" version on travis
@@ -41,8 +42,8 @@ before_script:
4142
- sudo sysctl -w vm.max_map_count=262144
4243

4344
script:
44-
- make tests TARGET=$TARGET
45-
- if [ "$TARGET" == "72" ] ; then make check-style ; fi
45+
- if [ "$TARGET" != "Lint" ] ; then make tests TARGET=$TARGET ; fi
46+
- if [ "$TARGET" == "Lint" ] ; then make check-style ; fi
4647

4748
after_script:
4849
- cat /var/log/elasticsearch/*.log

Makefile

+6-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ tests:
6161
make start
6262
mkdir -p build
6363

64-
docker run -e "ES_HOST=elasticsearch" --network=elastica_esnet elastica_elastica make phpunit
64+
docker run -e "ES_HOST=elasticsearch" --network=elastica_esnet elastica_elastica make phpunit
6565
docker cp elastica:/elastica/build/coverage/ $(shell pwd)/build/coverage
6666

6767
# Makes it easy to run a single test file. Example to run IndexTest.php: make test TEST="IndexTest.php"
@@ -83,6 +83,11 @@ lint:
8383

8484
.PHONY: check-style
8585
check-style:
86+
docker build -t ruflin/elastica-dev-base -f env/elastica/${TARGET} env/elastica/
87+
docker build -t ruflin/elastica .
88+
make start
89+
mkdir -p build
90+
8691
${RUN_ENV} php-cs-fixer fix --allow-risky=yes --dry-run
8792

8893
.PHONY: loc

env/elastica/Docker70

-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,5 @@ ENV PATH=/root/composer/vendor/bin:$PATH
3434

3535
COPY composer.json /root/composer/
3636

37-
RUN composer global require --no-update friendsofphp/php-cs-fixer:^2.0
38-
3937
# Install development tools, prefer source removed as automatic fallback now
4038
RUN composer global install

env/elastica/Docker71

-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,5 @@ ENV PATH=/root/composer/vendor/bin:$PATH
3434

3535
COPY composer.json /root/composer/
3636

37-
RUN composer global require --no-update friendsofphp/php-cs-fixer:^2.0
38-
3937
# Install development tools, prefer source removed as automatic fallback now
4038
RUN composer global install

env/elastica/Docker72

-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,5 @@ ENV PATH=/root/composer/vendor/bin:$PATH
3232

3333
COPY composer.json /root/composer/
3434

35-
RUN composer global require --no-update friendsofphp/php-cs-fixer:^2.0
36-
3735
# Install development tools, prefer source removed as automatic fallback now
3836
RUN composer global install

env/elastica/Lint

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This image is the base image for the Elastica development and includes all parts which rarely change
2+
# PHP 7 Docker file with Composer installed
3+
FROM php:7.2
4+
MAINTAINER Nicolas Ruflin <[email protected]>
5+
6+
RUN apt-get update && apt-get install -y \
7+
cloc \
8+
git \
9+
graphviz \
10+
libxslt-dev \
11+
nano \
12+
zip unzip \
13+
wget
14+
# XSL and Graphviz for PhpDocumentor
15+
16+
RUN docker-php-ext-install sockets xsl
17+
18+
RUN rm -r /var/lib/apt/lists/*
19+
20+
# Xdebug for coverage report
21+
RUN pecl install xdebug-2.6.1
22+
23+
RUN echo "memory_limit=1024M" >> /usr/local/etc/php/conf.d/memory-limit.ini
24+
RUN echo "date.timezone=UTC" >> /usr/local/etc/php/conf.d/timezone.ini
25+
26+
# Install and setup composer
27+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
28+
ENV COMPOSER_HOME /root/composer
29+
30+
# Add composer bin to the environment
31+
ENV PATH=/root/composer/vendor/bin:$PATH
32+
33+
COPY composer.json /root/composer/
34+
35+
RUN composer global remove --no-update phpdocumentor/phpdocumentor -vvv
36+
RUN composer global require --no-update friendsofphp/php-cs-fixer:^2.0
37+
38+
# Install development tools, prefer source removed as automatic fallback now
39+
RUN composer global install -vvv

env/elastica/composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
],
1414
"require": {
1515
"php": "^7.0",
16+
"phpdocumentor/phpdocumentor": "^2.9",
1617
"mayflower/php-codebrowser": "~1.1",
1718
"pdepend/pdepend": "^2.5",
1819
"phploc/phploc": "^4.0",

0 commit comments

Comments
 (0)