Skip to content

Commit 6be1384

Browse files
committed
add jobs
1 parent 45ae54e commit 6be1384

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

.github/workflows/ci.yml

+21
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,26 @@ jobs:
2222
- name: 🐳 Start all the environment
2323
run: make start-docker
2424

25+
- name: 🦭 Wait for the database to get up
26+
run: |
27+
while ! make ping-mysql &>/dev/null; do
28+
echo "Waiting for database connection..."
29+
sleep 2
30+
done
31+
32+
- name: 🧪 Wait for the elasticsearch to get up
33+
run: |
34+
while ! make ping-elasticsearch &>/dev/null; do
35+
echo "Waiting for elasticsearch connection..."
36+
sleep 2
37+
done
38+
39+
- name: 🐰 Wait for the message broker to get up
40+
run: |
41+
while ! make ping-rabbitmq &>/dev/null; do
42+
echo "Waiting for RabbitMQ connection..."
43+
sleep 2
44+
done
45+
2546
- name: ✅ Run the tests
2647
run: make test

Makefile

+13-1
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,16 @@ start-docker stop-docker destroy-docker: composer-env-file
110110
rebuild-docker: composer-env-file
111111
make deps
112112
make start-docker
113-
docker compose build --pull --force-rm --no-cache
113+
docker compose build --pull --force-rm --no-cache
114+
115+
.PHONY: ping-mysql
116+
ping-mysql:
117+
@docker exec librarify-php_ddd_mysql mysqladmin --user=root --password= --host "127.0.0.1" ping --silent
118+
119+
.PHONY: ping-elasticsearch
120+
ping-elasticsearch:
121+
@curl -I -XHEAD localhost:9200
122+
123+
.PHONY: ping-rabbitmq
124+
ping-rabbitmq:
125+
@docker exec librarify-php_ddd-rabbitmq rabbitmqctl ping --silent

0 commit comments

Comments
 (0)