Skip to content

PHPUnit fails with invalid environment values #75

@BradleyGoulding

Description

@BradleyGoulding

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions