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

Empty "CodeCoverage" directory #475

Open
vicellobre opened this issue Sep 1, 2024 · 0 comments
Open

Empty "CodeCoverage" directory #475

vicellobre opened this issue Sep 1, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@vicellobre
Copy link

Bug description

When using the game-ci/[email protected] action, a CodeCoverage folder is created in the root directory. However, when subsequently using actions/upload-artifact@v4, the following message appears:

“No files were found with the provided path: CodeCoverage. No artifacts will be uploaded.”

Steps to reproduce

  1. Execute the tests:
uses: game-ci/[email protected]
        id: tests
        env:
          UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
          UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
          UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
        with:
          projectPath: ${{ matrix.projectPath }}
          testMode: ${{ matrix.testMode }}
          artifactsPath: ${{ matrix.testMode }}-artifacts
          githubToken: ${{ secrets.GITHUB_TOKEN }}
          checkName: ${{ matrix.testMode }} Test Results
          coverageOptions: 'generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+my.assembly.*;dontClear'
  1. Upload the CodeCoverage results to Artifacts:
uses: actions/upload-artifact@v4
        if: always()
        with:
          name: Coverage results for ${{ matrix.testMode }}
          path: ${{ steps.tests.outputs.coveragePath }}
  1. The result is:

Run actions/upload-artifact@v4
with:
name: Coverage results for editmode
path: CodeCoverage
if-no-files-found: warn
compression-level: 6
overwrite: false
Warning: No files were found with the provided path: CodeCoverage. No artifacts will be uploaded.

I suspect there might be permission issues or misconfiguration related to the CodeCoverage package in Unity.
If that’s the case, please provide the correct configuration for the CodeCoverage package in Unity.

Expected behavior

I expect to receive a message similar to:

Run actions/upload-artifact@v4
With the provided path, there will be 2 files uploaded
Artifact name is valid!
Root directory input is valid!
Beginning upload of artifact content to blob storage
Uploaded bytes 36991
Finished uploading artifact content to blob storage!

Additional details

  1. The project path is defined as:
runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        projectPath:
          - ./
        testMode:
          - playmode
          - editmode
  1. After executing game-ci/[email protected], I can confirm that the CodeCoverage and editmode-artifacts folders are created. They also appear to have the same permissions
    folders

  2. The content of the CodeCoverage folder is not empty
    image

  3. Content of the CodeCoverage/workspace-opencov directory
    image

  4. Content of the CodeCoverage/workspace-opencov/EditMode directory
    image

  5. I’ve attempted changing permissions using run: sudo chown -R $USER:$USER "CodeCoverage" and run: sudo chmod -R a+rw "CodeCoverage":
    image
    image

  6. I renamed the CodeCoverage folder to CodeCoverageRenamed, and there were modifications to permissions
    image
    image

  7. The actions/upload-artifact@v4 action seems fine for other foulders with regular files, but the CodeCoverage folder isn’t behaving as expected.
    image

  8. Even when applying actions/upload-artifact@v4 at the root of the project, the CodeCoverage folder doesn’t appear in the generated .zip artifact.
    image

  9. According to the documentation, coverage results are generated with root permissions, so you may need elevated permissions (like sudo) for later steps:

Note Coverage results are generated with root permission so to move or edit the output in later steps you may need to use elevated permissions such as sudo.

image

  1. The project has both EditMode and PlayMode tests.
  2. The CodeCoverage package is installed.

Link to repository: BaseProject

@vicellobre vicellobre added the bug Something isn't working label Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant