Skip to content

Add health check to make sure MariaDB is ready in test #8

Add health check to make sure MariaDB is ready in test

Add health check to make sure MariaDB is ready in test #8

Workflow file for this run

name: Python CI
on:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb:latest
ports:
- 6666:3306
env:
MYSQL_DATABASE: rainfall_test
ALLOW_EMPTY_ROOT_PASSWORD: 1
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12.x'
architecture: 'x64'
- name: Copy .env.ci
run: cp .env.ci .env
- name: Install dependencies
run: |
python -m pip install --upgrade pip pipenv
pipenv install -d
- name: Run tests
run: pipenv run pytest