-
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.
use GitHub Action isbang/compose-action to manage Docker containers
- Loading branch information
Showing
1 changed file
with
9 additions
and
10 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
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 ] | ||
|
||
|
@@ -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" |