Skip to content

Commit

Permalink
Test PDO adapter also with MySQL.
Browse files Browse the repository at this point in the history
Signed-off-by: Janez Urevc <janez@tag1.com>
  • Loading branch information
slashrsm committed Aug 2, 2024
1 parent 3cb4c6b commit a04d1e4
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ jobs:
REDIS_HOST: redis
# The default Redis port
REDIS_PORT: 6379
# MySQL
DB_DATABASE: test
DB_USER: root
DB_PASSWORD: root

steps:
- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -40,9 +45,23 @@ jobs:

- name: Install dependencies
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest

- name: Start Redis
uses: supercharge/redis-github-action@1.1.0
with:
redis-version: ${{ matrix.redis-version }}
- name: Execute tests

- name: Execute tests (PDO with Sqlite)
run: vendor/bin/phpunit

- name: Start MySQL
run: |
sudo /etc/init.d/mysql start
mysql -e "CREATE DATABASE IF NOT EXISTS $DB_DATABASE;" -u$DB_USER -p$DB_PASSWORD
- name: Execute PDO tests with MySQL
env:
TEST_PDO_DSN: 'mysql:host=localhost;dbname=test'
TEST_PDO_USERNAME: 'root'
TEST_PDO_PASSWORD: 'root'
run: vendor/bin/phpunit tests/Test/Prometheus/PDO

0 comments on commit a04d1e4

Please sign in to comment.