-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds resources for running tests on CI
- Loading branch information
1 parent
1abd9a5
commit f1f244e
Showing
5 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM php:7.2-cli | ||
|
||
# Install PHP extensions and composer | ||
RUN apt-get update && \ | ||
apt-get install -y libzip-dev zlib1g-dev zip && \ | ||
docker-php-ext-install zip && \ | ||
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer | ||
|
||
# Copy application files | ||
RUN mkdir -p /usr/src/zamzar-php | ||
COPY . /usr/src/zamzar-php | ||
WORKDIR /usr/src/zamzar-php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.PHONY: up test | ||
|
||
up: | ||
@docker compose up -d | ||
@docker compose exec php composer install --no-interaction | ||
|
||
test: up | ||
@docker compose exec php vendor/bin/phpunit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
version: '3' | ||
services: | ||
php: | ||
build: . | ||
depends_on: | ||
- mock | ||
entrypoint: [ "/bin/sh", "-c", "sleep infinity" ] | ||
environment: | ||
- ZAMZAR_API_KEY=GiVUYsF4A8ssq93FR48H | ||
- ZAMZAR_API_URL=http://mock:8080 | ||
volumes: | ||
- '.:/usr/src/zamzar-php' | ||
working_dir: '/usr/src/zamzar-php' | ||
mock: | ||
image: zamzar/zamzar-mock:latest | ||
ports: | ||
- "8080:8080" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" | ||
bootstrap="vendor/autoload.php" | ||
colors="true" | ||
> | ||
<testsuites> | ||
<testsuite name="Unit"> | ||
<directory>./tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |