Skip to content
This repository was archived by the owner on Nov 28, 2022. It is now read-only.
Open
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
14 changes: 14 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Test in Docker

on: push

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: 🚚 Checkout Repo
uses: actions/checkout@v2
- name: 🐳 Build Container
run: docker-compose build
- name: 🧪 Test in Docker
run: docker-compose up
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ vendor/
composer.lock
coverage/
.phpunit.result.cache
.cache/
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,15 @@ $architecture = (new Architecture)
->addComposerBasedComponent('packages/subpackage/composer.json');
```

## Development Environment

Unit tests can be run using docker:

```bash
docker-compose build
docker-compose up
```

## Examples

- [PHPArch tests its own architecture](./tests/ArchitectureTest.php)
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: '2'

services:
php:
build: ./
working_dir: /phparch
command: bash -c "composer install && ./vendor/bin/phpunit -vvv"
volumes:
- ./:/phparch
4 changes: 4 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM php:7.4-cli
RUN apt-get update
RUN apt-get install -y git zip
COPY --from=composer /usr/bin/composer /usr/bin/composer