phpunit
phpunit copied to clipboard
Setting the working directory
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"
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.