-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (36 loc) · 1.66 KB
/
unit_tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Unit Tests
on: [ push, pull_request, workflow_dispatch ]
jobs:
ci:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
phpunit: ["~8.0.0", "~8.0", "~9.0.0", "~9.0"]
name: Run Tests With PHPUnit ${{ matrix.phpunit }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Start Docker Containers
uses: isbang/[email protected]
- name: Install Dependencies
run: |
set -ex
sleep 15 # Seems that we need to give the MySQL container enough time to warm up.
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
# Run tests using PHPUnit (Swoole is disabled).
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 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 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 compose exec -T swoole ./counit --testsuite global
docker compose exec -T swoole ./counit --testsuite case-by-case