Skip to content

Commit 784613e

Browse files
authored
[TASK] Add tests for Redis and MariaDB
1 parent e97df00 commit 784613e

File tree

1 file changed

+36
-14
lines changed

1 file changed

+36
-14
lines changed

.github/workflows/docker-compose-test.yml

+36-14
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,39 @@ jobs:
2929
run: |
3030
docker-compose -f docker-compose.yml up --build -d
3131
32-
- name: Test Xdebug
33-
run: |
34-
sleep 10 # Wait for the containers to fully initialize
35-
XDEBUG_OUTPUT=$(curl -s http://localhost/index.php)
36-
if [[ ! "$XDEBUG_OUTPUT" =~ "Xdebug" ]]; then
37-
echo "Xdebug test failed. Not found in phpinfo() output."
38-
exit 1
39-
else
40-
echo "Xdebug test successful."
41-
fi
42-
43-
- name: Cleanup
44-
run: |
45-
docker-compose -f docker-compose.yml down
32+
- name: Test Xdebug
33+
run: |
34+
sleep 10 # Wait for the containers to fully initialize
35+
XDEBUG_OUTPUT=$(curl -s http://localhost/index.php)
36+
if [[ ! "$XDEBUG_OUTPUT" =~ "Xdebug" ]]; then
37+
echo "Xdebug test failed. Not found in phpinfo() output."
38+
exit 1
39+
else
40+
echo "Xdebug test successful."
41+
fi
42+
43+
- name: Test Redis
44+
run: |
45+
sleep 5
46+
REDIS_TEST=$(docker-compose exec -T redis redis-cli ping)
47+
if [[ "$REDIS_TEST" != "PONG" ]]; then
48+
echo "Redis test failed. No PONG response."
49+
exit 1
50+
else
51+
echo "Redis test successful."
52+
fi
53+
54+
- name: Test MariaDB
55+
run: |
56+
sleep 5
57+
MYSQL_TEST=$(docker-compose exec -T mariadb mysql -u${{ secrets.MARIADB_USER }} -p${{ secrets.MARIADB_PASSWORD }} -e "SHOW DATABASES;")
58+
if [[ ! "$MYSQL_TEST" =~ "${MARIADB_DATABASE}" ]]; then
59+
echo "MariaDB test failed. Cannot show databases."
60+
exit 1
61+
else
62+
echo "MariaDB test successful."
63+
fi
64+
65+
- name: Cleanup
66+
run: |
67+
docker-compose -f docker-compose.yml down

0 commit comments

Comments
 (0)