fix: add missing service container health check (#2354)

* fix: Implement missing health ceck for Services

* Add test case

* linter doesn't support min builtin and fix check

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
ChristopherHX
2024-07-10 17:33:54 +02:00
committed by GitHub
parent 1ac4b60a06
commit 2ad5ff74f8
6 changed files with 93 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
name: service-container
on: push
jobs:
service-container-test:
runs-on: ubuntu-latest
container: mysql:8
services:
maindb:
image: mysql:8
env:
MYSQL_DATABASE: dbname
MYSQL_USER: dbuser
MYSQL_PASSWORD: dbpass
MYSQL_RANDOM_ROOT_PASSWORD: yes
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- run: mysql -u dbuser -D dbname -pdbpass -h maindb -e "create table T(id INT NOT NULL AUTO_INCREMENT, val VARCHAR(255), PRIMARY KEY (id))"
- run: mysql -u dbuser -D dbname -pdbpass -h maindb -e "insert into T(val) values ('test'),('h')"
- run: mysql -u dbuser -D dbname -pdbpass -h maindb -e "select * from T"