Skip to content

Commit

Permalink
workflows: Provide mysql service & build php with mysql ext
Browse files Browse the repository at this point in the history
  • Loading branch information
yhabteab committed Feb 13, 2023
1 parent eb695c4 commit b76aa63
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,22 @@ jobs:
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
os: ['ubuntu-latest']

services:
mysql:
image: mariadb
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: icingadb_web_unittest
MYSQL_USER: icingadb_web_unittest
MYSQL_PASSWORD: icingadb_web_unittest
options: >-
--health-cmd "mysql -s -uroot -proot -e'SHOW DATABASES;' 2> /dev/null | grep icingadb_web_unittest > test"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 3306/tcp

steps:
- name: Checkout code base
uses: actions/checkout@v3
Expand All @@ -63,6 +79,7 @@ jobs:
with:
php-version: ${{ matrix.php }}
tools: phpunit:${{ matrix.phpunit-version || env.phpunit-version }}
extensions: mysql

- name: Setup Icinga Web
run: |
Expand All @@ -78,4 +95,5 @@ jobs:
- name: PHPUnit
env:
ICINGAWEB_LIBDIR: _libraries
ICINGADBWEB_TEST_MYSQL_PORT: ${{ job.services.mysql.ports['3306'] }}
run: phpunit --verbose --bootstrap _icingaweb2/test/php/bootstrap.php

0 comments on commit b76aa63

Please sign in to comment.