Skip to content
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

Unable to use Action on Self-Hosted Windows Runner with powershell shell #634

Closed
sesa623061 opened this issue Oct 23, 2024 · 15 comments
Closed
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@sesa623061
Copy link

We are trying using the Windows version of action to publish unit tests, but we are getting below error as mentioned in the screen shot.
image

Below is the task which we have added in the yml file.

- name: Setup Python
  uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
  with:
    python-version: '3.10'

- name: Publish unit tests results
  uses: EnricoMi/publish-unit-test-result-action/windows@30eadd5010312f995f0d3b3cff7fe2984f69409e
  if: always() && ${{ (inputs.unittests) || (github.event_name == 'pull_request') }}
  with:
    files: |
      ${{ github.workspace }}/src/TestResults.xml
      ${{ github.workspace }}/src/CoverageReport/Cobertura.xml
      ${{ github.workspace }}/src/OpenCover.xml
@EnricoMi
Copy link
Owner

Looks like you do not have PowerShell (pwsh) installed.

@sesa623061
Copy link
Author

Thannks for your reply @EnricoMi , I have Powershell installed already in my machine and same is updated at environment variables also.
image

@sesa623061
Copy link
Author

sesa623061 commented Oct 23, 2024

and most of my steps inside workflow runs using shell: powershell only

image

@EnricoMi
Copy link
Owner

Looks like PowerShell v5 provides powershell.exe whereas PowerShell v6 and v7 provide pwsh.exe.

@EnricoMi
Copy link
Owner

Can you test the following please:

uses: EnricoMi/publish-unit-test-result-action/windows/powershell@windows-powershell

@sesa623061
Copy link
Author

sesa623061 commented Oct 24, 2024

This action is tag is not allowed as of now in my enterprise organization. but let me download the action manually and test once please.

@sesa623061
Copy link
Author

@EnricoMi , I dont find any action/sub folder for powershell under windows folder in the code. Can i still use the action as you mentioned?
image

uses: EnricoMi/publish-unit-test-result-action/windows/powershell@windows-powershell

@EnricoMi
Copy link
Owner

Check out branch windows-powershell, there is windows/powershell.

@sesa623061
Copy link
Author

I have tried this - uses: EnricoMi/publish-unit-test-result-action/windows/powershell@windows-powershell
but I am getting this error every time. Module not found for 3.8, 3.10 & 3.12 versions of python.
image

@EnricoMi
Copy link
Owner

Looks like powershell has a different syntax than pwsh. I would need to setup a powershell environment to migrate and test the pwsh script.

@EnricoMi EnricoMi changed the title Unable to use Action on Self-Hosted Windows Runner Unable to use Action on Self-Hosted Windows Runner with powershell shell Oct 25, 2024
@EnricoMi EnricoMi added enhancement New feature or request good first issue Good for newcomers labels Oct 25, 2024
@sesa623061
Copy link
Author

Thank you @EnricoMi, I have upgraded my powershell to v7 and now i can able to use the action and it seems working fine with v7. But few of the file formats are accepting it seems.
Below is the output summary of action with TestResults.xml

Is OpenCover.xml & Cobertura.xml are accepted formats in this action?

ERROR LOG:
image

@EnricoMi
Copy link
Owner

Sounds like those file contain test coverage information, which are not test result information.

@sesa623061
Copy link
Author

sesa623061 commented Oct 28, 2024

yes @EnricoMi , we have coverage information in it. do you have any plan to create an action to support coverage as well please?

@EnricoMi
Copy link
Owner

EnricoMi commented Nov 4, 2024

Adding coverage sounds like a natural fit for this action. But I have not looked into this. Happy to review pull requests on this area.

@EnricoMi
Copy link
Owner

I have created issues #640 and #639 to track these new features. Please reopen if there are any further issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants