diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 9f44dbe..bee1ba9 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -2,41 +2,30 @@ name: Run Python Tests permissions: contents: read -# ----------------- -# --- Triggers ---- -# ----------------- -# This section defines when the workflow will run. on: workflow_call: -# ----------------- -# ------ Jobs ----- -# ----------------- -# A workflow is made up of one or more jobs that can run in parallel or sequentially. jobs: - # A descriptive name for your job build-and-test: - # Specifies the virtual machine to run the job on. 'ubuntu-latest' is a common and cost-effective choice. runs-on: ubuntu-latest - # 1) Start a MariaDB service container for tests services: - # The label 'mariadb' becomes the hostname mariadb: image: mariadb:11.4 env: MARIADB_ROOT_PASSWORD: rootpw - # This DB name now matches what your app expects MARIADB_DATABASE: group_project MARIADB_USER: appuser MARIADB_PASSWORD: apppass + options: >- + --health-cmd="mysqladmin ping -h 127.0.0.1 -u root -prootpw --silent" + --health-interval=5s + --health-timeout=2s + --health-retries=20 - # 2) Expose DB connection settings to steps env: - # Use the service label 'mariadb' as the host MARIADB_HOST: mariadb - MARIADB_PORT: "3306" # This is the internal port, which is correct - # Match the database name from the service + MARIADB_PORT: "3306" MARIADB_DB: group_project MARIADB_USER: appuser MARIADB_PASSWORD: apppass