Skip to content

Commit

Permalink
add jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
serodas committed Aug 8, 2024
1 parent 45ae54e commit 6be1384
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,26 @@ jobs:
- name: 🐳 Start all the environment
run: make start-docker

- name: 🦭 Wait for the database to get up
run: |
while ! make ping-mysql &>/dev/null; do
echo "Waiting for database connection..."
sleep 2
done
- name: 🧪 Wait for the elasticsearch to get up
run: |
while ! make ping-elasticsearch &>/dev/null; do
echo "Waiting for elasticsearch connection..."
sleep 2
done
- name: 🐰 Wait for the message broker to get up
run: |
while ! make ping-rabbitmq &>/dev/null; do
echo "Waiting for RabbitMQ connection..."
sleep 2
done
- name: ✅ Run the tests
run: make test
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,16 @@ start-docker stop-docker destroy-docker: composer-env-file
rebuild-docker: composer-env-file
make deps
make start-docker
docker compose build --pull --force-rm --no-cache
docker compose build --pull --force-rm --no-cache

.PHONY: ping-mysql
ping-mysql:
@docker exec librarify-php_ddd_mysql mysqladmin --user=root --password= --host "127.0.0.1" ping --silent

.PHONY: ping-elasticsearch
ping-elasticsearch:
@curl -I -XHEAD localhost:9200

.PHONY: ping-rabbitmq
ping-rabbitmq:
@docker exec librarify-php_ddd-rabbitmq rabbitmqctl ping --silent

0 comments on commit 6be1384

Please sign in to comment.