-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update unit tests and Docker commands
- Loading branch information
Showing
3 changed files
with
30 additions
and
29 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 |
---|---|---|
|
@@ -16,39 +16,38 @@ jobs: | |
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Services | ||
- name: Start Docker Containers | ||
uses: isbang/[email protected] | ||
|
||
- name: Install Dependencies | ||
run: | | ||
docker-compose up -d | ||
docker exec -t $(docker ps -qf "name=swoole") sh -c "composer require phpunit/phpunit ${{ matrix.phpunit }} -nq --no-progress" | ||
set -ex | ||
sleep 15 # Seems that we need to give the MySQL container enough time to warm up. | ||
docker ps | ||
docker compose exec -T swoole composer require "phpunit/phpunit=${{ matrix.phpunit }}" -W -nq --no-progress | ||
docker compose exec -T swoole ./vendor/bin/phpunit --version # Check current version of PHPUnit. | ||
- name: Run Unit Tests | ||
run: | | ||
set -ex | ||
# Check current version of PHPUnit. | ||
docker exec -t $(docker ps -qf "name=swoole") sh -c "./vendor/bin/phpunit --version" | ||
# Run tests using PHPUnit (Swoole is disabled). | ||
docker exec -t $(docker ps -qf "name=php") sh -c "./vendor/bin/phpunit --testsuite global" | ||
docker exec -t $(docker ps -qf "name=php") sh -c "./vendor/bin/phpunit --testsuite case-by-case" | ||
docker compose exec -T php ./vendor/bin/phpunit --testsuite global | ||
docker compose exec -T php ./vendor/bin/phpunit --testsuite case-by-case | ||
# Run tests using PHPUnit, with Swoole enabled. | ||
docker exec -t $(docker ps -qf "name=swoole") sh -c "./vendor/bin/phpunit --testsuite global" | ||
docker exec -t $(docker ps -qf "name=swoole") sh -c "./vendor/bin/phpunit --testsuite case-by-case" | ||
docker compose exec -T swoole ./vendor/bin/phpunit --testsuite global | ||
docker compose exec -T swoole ./vendor/bin/phpunit --testsuite case-by-case | ||
# Run tests using counit (Swoole is disabled). | ||
docker exec -t $(docker ps -qf "name=php") sh -c "./counit --testsuite global" | ||
docker exec -t $(docker ps -qf "name=php") sh -c "./counit --testsuite case-by-case" | ||
docker compose exec -T php ./counit --testsuite global | ||
docker compose exec -T php ./counit --testsuite case-by-case | ||
# Run tests using counit, with Swoole enabled. | ||
docker exec -t $(docker ps -qf "name=swoole") sh -c "./counit --testsuite global" | ||
docker exec -t $(docker ps -qf "name=swoole") sh -c "./counit --testsuite case-by-case" | ||
docker compose exec -T swoole ./counit --testsuite global | ||
docker compose exec -T swoole ./counit --testsuite case-by-case | ||
# Test compatibility with PHPUnit. | ||
docker exec -t $(docker ps -qf "name=php") sh -c "./counit --testsuite compatibility" | ||
docker exec -t $(docker ps -qf "name=swoole") sh -c "./counit --testsuite compatibility" | ||
- name: Stop and Remove Docker Containers | ||
run: docker-compose down | ||
docker compose exec -T php ./counit --testsuite compatibility | ||
docker compose exec -T swoole ./counit --testsuite compatibility |
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