Skip to content

Commit

Permalink
use GitHub Action isbang/compose-action to manage Docker containers
Browse files Browse the repository at this point in the history
  • Loading branch information
deminy committed Jun 4, 2024
1 parent b9cd37d commit dac9dda
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests
name: Unit Tests

on: [ push, pull_request, workflow_dispatch ]

Expand All @@ -16,15 +16,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Services
- name: Customize Dockerfile
run: sed "s/%%PHP_VERSION%%/${{ matrix.php }}/g" Dockerfile.tpl > Dockerfile

- name: Start Docker Containers
uses: isbang/[email protected]

- name: Run Unit Tests
run: |
set -ex
sed "s/%%PHP_VERSION%%/${{ matrix.php }}/g" Dockerfile.tpl > Dockerfile
docker-compose up --quiet-pull -d
sleep 2 # Give the containers enough time to warm up before running unit tests.
- name: Run Unit Tests
run: docker compose exec -T php bash -c "./vendor/bin/phpunit"

- name: Stop and Remove Docker Containers
run: docker-compose down
docker compose exec -T php bash -c "./vendor/bin/phpunit"

0 comments on commit dac9dda

Please sign in to comment.