Skip to content

Build wheelhouse action piping unintended output and breaking tests #269

@raph-luc

Description

@raph-luc

The following line is trying to pipe the entire output of import and print commands into the GITHUB_ENV variable:

echo "library_version=$(python -c "from ${{ inputs.library-namespace }} import __version__; print(__version__)")" >> $GITHUB_ENV

If on import the package outputs anything, it breaks the action as it all gets merged into the GITHUB_ENV var. I believe that is the reason for this failure:
https://github.com/ansys/pyfluent/actions/runs/5114660367/jobs/9195134134?pr=1651
Due to:
image

I get bash: $GITHUB_ENV: ambiguous redirect if I try piping the entire output into a variable too, not sure how/why it works on the github runners (is it not bash?).

I believe we only want the output from the print(__version__) command piped into the GITHUB_ENV variable, in which case my suggestion would be to change line 92 to:

  • echo "library_version=$(python -c "from ${{ inputs.library-namespace }} import __version__; print(); print(__version__)" | tail -1)" >> $GITHUB_ENV so that we only pipe the last line of the output, which should include only the output from the print(version) command we want. Also that extra print(); to make sure output doesn't include any previous std output that did not end with a line break (shouldn't happen but probably better be safe).

An example commit where this was fixed and then the action Build Documentation which had previously failed for the same reason (and does not use build-wheelhouse) passed: ansys/pyfluent@c65473d

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions