Skip to content

PHPUnit fails with invalid environment values #75

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

Open
BradleyGoulding opened this issue May 15, 2025 · 0 comments
Open

PHPUnit fails with invalid environment values #75

BradleyGoulding opened this issue May 15, 2025 · 0 comments

Comments

@BradleyGoulding
Copy link

Description
I encountered an issue while using php-actions/phpunit@v3 in my GitHub Actions workflow. The workflow is set up as follows:

  - name: Run tests
    uses: php-actions/phpunit@v3
    with:
      php_version: "8.1"
      bootstrap: vendor/autoload.php
      configuration: phpunit.xml
      version: "9.5.27"

This is running on a blacksmith.sh arm runner

However, the installation fails with the following error message:

Run php-actions/phpunit@v3
Run set -e
Building PHP 8.1 with extensions:  ...
docker: invalid env file (/dev/fd/63): variable 'Available CPUs: 6' contains whitespaces

Run 'docker run --help' for more information
Error: Process completed with exit code 125.

Expected behavior:
The process should pass

Additional context:
I have forked this repo and debugged the --env-file <( env| cut -f1 -d= ) step and found the following

BLACKSMITH_STORE_STATS=System Statistics:
-----------------
Available CPUs: 10
Jobs by Process ID:
-----------------
PID 2055811: 13 jobs
Total: 13 jobs across 1 process
Devices by Process ID:
-----------------
PID 2055811: 13 devices
Total: 13 devices across 1 process

This is causing the docker process to fail

I have reached out to Blacksmith support to advise them of this, however I think that this action should also be sanitizing or otherwise checking the env values it reads
This action runs correctly on the github standard runners, I have also tested it on blacksmiths x86 runners with the same error being observed.

I have opened a PR with a patch for this process.
There is a linked issue php-actions/composer#128 that also has this problem

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

1 participant