Skip to content

Commit ec333e9

Browse files
committed
Small CI workflow updates
* Start RabbitMQ using `docker run` so a restart is not necessary. * Use latest `toxiproxy` version
1 parent 86d669c commit ec333e9

File tree

1 file changed

+15
-20
lines changed

1 file changed

+15
-20
lines changed

.github/workflows/phpunit.yml

+15-20
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,6 @@ jobs:
4141
phpseclib: '^3.0'
4242
composer: 'composer:v2'
4343
coverage: none
44-
services:
45-
rabbitmq:
46-
image: rabbitmq:3.11-management
47-
ports:
48-
- 5671:5671
49-
- 5672:5672
50-
- 15671:15671
51-
- 15672:15672
52-
volumes:
53-
- ${{ github.workspace }}:/src
54-
env:
55-
RABBITMQ_CONFIG_FILE: /src/tests/rabbitmq.conf
56-
proxy:
57-
image: ghcr.io/shopify/toxiproxy:2.5.0
58-
ports:
59-
- 8474:8474
60-
- 5673:5673
6144

6245
name: PHP ${{ matrix.php }} + phpseclib ${{ matrix.phpseclib }}
6346
env:
@@ -68,6 +51,21 @@ jobs:
6851
- name: Checkout
6952
uses: actions/checkout@v4
7053

54+
- name: Run Toxiproxy
55+
run: |
56+
docker run --detach --pull always \
57+
--publish 8474:8474 \
58+
--publish 5673:5673 \
59+
ghcr.io/shopify/toxiproxy:latest
60+
61+
- name: Run RabbitMQ
62+
run: |
63+
docker run --detach --pull always \
64+
--env RABBITMQ_CONFIG_FILE=/src/tests/rabbitmq.conf \
65+
--publish 5671:5671 --publish 5672:5672 \
66+
--publish 15671:15671 --publish 15672:15672 \
67+
--volume ${{ github.workspace }}:/src:ro rabbitmq:3-management
68+
7169
- name: Install PHP
7270
uses: shivammathur/setup-php@v2
7371
with:
@@ -79,9 +77,6 @@ jobs:
7977
- name: Check PHP info
8078
run: php tests/phpinfo.php
8179

82-
- name: Re-start broker service to pick up rabbitmq.conf
83-
run: docker restart ${{ job.services.rabbitmq.id }}
84-
8580
- name: Composer install
8681
run: composer require --prefer-dist --no-progress --no-suggest phpseclib/phpseclib ${{ matrix.phpseclib }}
8782

0 commit comments

Comments
 (0)