Skip to content

workflow - test db as services #1

workflow - test db as services

workflow - test db as services #1

Workflow file for this run

on:

Check failure on line 1 in .github/workflows/r-cmd.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/r-cmd.yml

Invalid workflow file

No steps defined in `steps` and no workflow called in `uses` for the following jobs: build-and-test
push:
branches:
- master # Adjust if your default branch has a different name
pull_request:
branches:
- master
jobs:
build-and-test:
runs-on: ubuntu-latest
services:
mysql:
image: mysql-custom:latest
build:
context: .
dockerfile: tests/db/mysql/Dockerfile
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: testSchema
MYSQL_USER: testUser
MYSQL_PASSWORD: 3WBUT7My996BLVoTZHo3
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping -h localhost -u root --password=root"
--health-interval=10s
--health-timeout=5s
--health-retries=5
mariadb:
image: mariadb-custom:latest
build:
context: .
dockerfile: tests/db/mariadb/Dockerfile
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: testSchema
MYSQL_USER: testUser
MYSQL_PASSWORD: 3WBUT7My996BLVoTZHo3
ports:
- 3307:3306
options: >-
--health-cmd="mysqladmin ping -h localhost -u root --password=root"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
- uses: actions/checkout@v3
- name: Wait for MySQL to be ready
run: |
echo "Waiting for MySQL..."
sleep 30 # Wait a bit longer to ensure MySQL is fully ready
- name: Check MySQL connection
run: |
mysql -h 127.0.0.1 -P 3306 -u root --password=root -e "SHOW DATABASES;"
- name: Wait for MariaDB to be ready
run: |
echo "Waiting for MariaDB..."
sleep 30 # Wait a bit longer to ensure MariaDB is fully ready
- name: Check MariaDB connection
run: |
mysql -h 127.0.0.1 -P 3307 -u root --password=root -e "SHOW DATABASES;"