diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e331548e..e7fb858e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 @@ -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 \ No newline at end of file