Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add test-docker rule #742

Merged
merged 3 commits into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Comment on lines -9 to +13
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change instead of using curl?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figured it was more of a best practice to use the proper composer image rather than curl it

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