Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extensions not working #111

Open
oti-adjei opened this issue Oct 25, 2023 · 1 comment
Open

Extensions not working #111

oti-adjei opened this issue Oct 25, 2023 · 1 comment

Comments

@oti-adjei
Copy link

Hi, I'm a bit new to GitHub Actions and I'm using the composer version to include PDO as well as PHPunit in my .yml
I get this error when I run my Github Action:

13) App\test\model\ProductTest::testUpdateProduct
PDOException: could not find driver

So far this is my .yml:

name: CI

on:
  push:
    branches:
      - OOP
jobs:
  build-test:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3   
      - uses: php-actions/composer@v6
        with:
          php_version: "8.2"
          php_extensions: pdo_mysql
      - name: PHPUnit Tests
        uses: php-actions/phpunit@master
        with:
          version: 9.6
          bootstrap: vendor/autoload.php
          configuration: ./phpunit.xml
          args: --coverage-text

Am I doing something wrong?

@g105b
Copy link
Member

g105b commented Oct 25, 2023

Each step in your workflow runs isolated, so you're able to specify the PHP version and available extensions on the composer and phpunit step individually. You've specified the extension in the Composer step, but not on your unit tests, so PHPUnit won't be running in a container with access to that extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants