Skip to content

MariaDB as service in GitHub workflow #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ jobs:
env:
SYMFONY_DEPRECATIONS_HELPER: disabled

services:
mariadb:
image: mariadb:10.6
env:
MARIADB_ROOT_PASSWORD: root
ports:
- 3307:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

strategy:
matrix:
php-version:
Expand All @@ -25,6 +34,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Load data fixtures in another test database
run: |
mysql --host=mariadb -uroot -proot --port=3307 -e "DROP DATABASE IF EXISTS test_db";
mysql --host=mariadb -uroot -proot --port=3307 -e "CREATE DATABASE test_db";
mysql --host=mariadb -uroot -proot --port=3307 test_db < src/Faker/Provider/fixture.sql

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
Expand All @@ -40,10 +55,7 @@ jobs:
with:
composer-options: "--ignore-platform-reqs"

- name: Start mariadb
run: docker-compose -f docker-compose.test.yaml up -d mariadb

- name: Start other Docker services
- name: Start Docker services
run: docker-compose -f docker-compose.test.yaml up -d minio createbuckets ftpserver

- name: Load Doctrine fixtures
Expand All @@ -59,11 +71,8 @@ jobs:
env:
SYMFONY_DEPRECATIONS_HELPER: disabled

- name: Stop other Docker services
- name: Stop Docker services
run: docker-compose -f docker-compose.test.yaml stop createbuckets minio ftpserver

- name: Stop mariadb
run: docker-compose -f docker-compose.test.yaml stop mariadb

- name: Upload to Codecov
uses: codecov/codecov-action@v3