Skip to content

Commit 84d6d9e

Browse files
Refactor CI workflow to use Docker for MariaDB
1 parent c97b7f5 commit 84d6d9e

File tree

1 file changed

+29
-6
lines changed

1 file changed

+29
-6
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,35 @@ jobs:
8282
- name: Run Infection tests
8383
run: vendor/bin/infection --skip-initial-tests --coverage=build/logs/phpunit --min-covered-msi=80 --threads=30
8484

85-
- name: Install MariaDB
86-
uses: getong/mariadb-action@v1.11
87-
with:
88-
mysql database: 'bewelcome_test'
89-
mysql user: 'bewelcome'
90-
mysql password: 'bewelcome'
85+
# - name: Install MariaDB
86+
# uses: getong/mariadb-action@v1.11
87+
# with:
88+
# mysql database: 'bewelcome_test'
89+
# mysql user: 'bewelcome'
90+
# mysql password: 'bewelcome'
9191

92+
- name: Setup MariaDB 12.0.2
93+
run: |
94+
docker run -d --name=mariadb \
95+
-e MARIADB_ROOT_PASSWORD=bewelcome \
96+
-e MARIADB_DATABASE=bewelcome_test \
97+
-p 3306:3306 \
98+
--health-cmd="mariadb-admin ping -h 127.0.0.1 -proot || exit 1" \
99+
--health-interval=10s \
100+
--health-timeout=5s \
101+
--health-retries=10 \
102+
mariadb:12.0.2
103+
104+
echo "Waiting for MariaDB to be ready..."
105+
for i in {1..60}; do
106+
if docker exec mariadb mariadb-admin ping -h 127.0.0.1 -proot >/dev/null 2>&1; then
107+
echo "MariaDB is responding."
108+
break
109+
fi
110+
111+
sleep 2
112+
done
113+
92114
- name: Create test database
93115
run: bin/console test:database:create --env=test
94116

@@ -374,3 +396,4 @@ jobs:
374396

375397

376398

399+

0 commit comments

Comments
 (0)