php-actions / phpunit

Run PHPUnit tests in Github Actions.
106 stars 23 forks source link

Setting the working directory #46

Closed leanndemetro closed 2 months ago

leanndemetro commented 1 year ago

Hello! I'm trying to set my working directory to src as my project exists within it. I am unable to find a method by which to configure this while using php-actions/phpunit@v3 - my current code is below

name: CI-Composer-v4

on: [push]

jobs:
  build-test:
    runs-on: ubuntu-latest
    services:
      mysql:
        image: mysql:5.7
        env:
          MYSQL_ROOT_PASSWORD: ${{ secrets.MYSQL_ROOT_PASSWORD }}
          MYSQL_DATABASE: ${{ secrets.MYSQL_DATABASE }}
        ports:
          - 3306/tcp
        options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

    steps:
      - uses: actions/checkout@v2
      - name: Install dependencies
        uses: php-actions/composer@v4
        with:
          working_dir: ./src
          composer_version: 1
          php_version: 7.3
          ssh_key: ${{ secrets.SSH_KEY }}
          ssh_key_pub: ${{ secrets.SSH_KEY_PUB }}
      - name: PHPUnit Tests
        uses: php-actions/phpunit@v3
        env:
          APP_DEBUG: ${{ secrets.APP_DEBUG }}
          APP_KEY: ${{ secrets.APP_KEY }}
          APP_ENV: ${{ secrets.APP_ENV }}
          IS_USING_TEST_ENV: ${{ secrets.IS_USING_TEST_ENV }}
          DB_HOST: ${{ secrets.DB_HOST }}
          DB_HOST_READONLY: ${{ secrets.DB_HOST_READONLY }}
          DB_DATABASE: ${{ secrets.DB_DATABASE }}
          DB_USERNAME: ${{ secrets.DB_USERNAME }}
          DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
          DB_PORT: ${{ secrets.DB_PORT }}
          QUEUE_DRIVER: ${{ secrets.QUEUE_DRIVER }}
          JWT_SECRET: ${{ secrets.JWT_SECRET }}
          JWT_TIMEOUT: ${{ secrets.JWT_TIMEOUT }}
          SPREEDLY_SECRET: ${{ secrets.SPREEDLY_SECRET }}
          SPREEDLY_KEY: ${{ secrets.SPREEDLY_KEY }}
          SPREEDLY_GATEWAY: ${{ secrets.SPREEDLY_GATEWAY }}
        with:
          php_extensions: xdebug
          bootstrap: ./src/bootstrap/app.php
          configuration: ./src/phpunit.xml
          args: --coverage-text
          php_version: "7.3"
g105b commented 1 year ago

Hi @leanndemetro ,

Firstly, sorry for taking so long to get around to this. I have more time for open source contributions now so I'll try and get a solution for you.

Do you have a link to some test runs that I can look at the output of? I'll try and replicate your issue within php-actions/example-phpunit to see for myself.

Greg.