Skip to content

Commit

Permalink
test: add test-docker rule (#742)
Browse files Browse the repository at this point in the history
* test: add test-docker rule
  • Loading branch information
Bilal Boussayoud committed Aug 11, 2022
1 parent 94aa139 commit 10c7f8b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
FROM php:7.4

RUN apt-get update -y && apt-get install -y zip

RUN mkdir /twilio
WORKDIR /twilio
ENV PATH="vendor/bin:$PATH"

COPY src src
COPY tests tests
COPY composer* ./

RUN curl --silent --show-error https://getcomposer.org/installer | php
RUN mv composer.phar /usr/local/bin/composer
RUN composer install --no-dev
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
RUN composer install --prefer-dist
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Twilio API helper library.
# See LICENSE file for copyright and license details.
.PHONY: all clean install test test-docker docs authors docker-dev-build docker-dev-clean docker-dev-test

COMPOSER = $(shell which composer)
ifeq ($(strip $(COMPOSER)),)
Expand All @@ -21,6 +22,10 @@ vendor: install
test:
@PATH=vendor/bin:$(PATH) phpunit -d memory_limit=512M --strict-coverage --disallow-test-output --colors --configuration tests/phpunit.xml --coverage-clover=coverage.xml

test-docker:
docker build -t twilio/twilio-php .
docker run twilio/twilio-php phpunit -d memory_limit=512M --disallow-test-output --colors --configuration tests/phpunit.xml

PHPDOX_DIR=vendor-theseer
docs-install:
COMPOSER_VENDOR_DIR=${PHPDOX_DIR} composer require --dev theseer/phpdox:\^0.12.0
Expand Down Expand Up @@ -57,5 +62,3 @@ docker-dev-clean:

docker-dev-test:
docker exec -t twilio_php${VERSION} /bin/bash -c 'make all'

.PHONY: all clean install test docs authors docker-dev-build docker-dev-clean docker-dev-test

0 comments on commit 10c7f8b

Please sign in to comment.