game-ci / game-ci/documentation

Empty "CodeCoverage" directory

Open
#475 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
MDX
Stars
243
Forks
130
Avg merge
15d 42m
Merged PRs (30d)
1

Description

**Bug description**

When using the `game-ci/unity-test-runner@v4.3.1` 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/unity-test-runner@v4.3.1
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'
```
2. 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 }}
```
3. The result is:

> Run actions/upload-artifact@v4
> with:
> name: Coverage results for editmode
> path: CodeCoverage
> if-no-files-found: warn
> compression-level: [6](https://github.com/vicellobre/BaseProject/actions/runs/10648582142/job/29517800817#step:6: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
```
2. After executing `game-ci/unity-test-runner@v4.3.1`, I can confirm that the **CodeCoverage** and **editmode-artifacts** folders are created. They also appear to have the same permissions
![folders](https://github.com/user-attachments/assets/21420504-11c1-4224-8051-b11d1e2d9ac3)

3. The content of the **CodeCoverage** folder is not empty
![image](https://github.com/user-attachments/assets/5e7d54ac-f922-4012-8642-10952aa174e2)

4. Content of the **CodeCoverage/workspace-opencov directory**
![image](https://github.com/user-attachments/assets/03e8e90e-109c-4c35-9437-ef562bc71e7e)

5. Content of the **CodeCoverage/workspace-opencov/EditMode** directory
![image](https://github.com/user-attachments/assets/c6e53eaa-1074-4b6e-9950-1525d4db5ef4)

6. I’ve attempted changing permissions using `run: sudo chown -R $USER:$USER "CodeCoverage"` and `run: sudo chmod -R a+rw "CodeCoverage"`:
![image](https://github.com/user-attachments/assets/532675f9-6b33-4872-b6a9-22d1bbab2728)
![image](https://github.com/user-attachments/assets/ad570165-6bfd-47f8-ad7b-5163096f4f18)

7. I renamed the **CodeCoverage** folder to **CodeCoverageRenamed**, and there were modifications to permissions
![image](https://github.com/user-attachments/assets/c8e2c1f4-81ec-49cb-9874-0a82aadb244e)
![image](https://github.com/user-attachments/assets/56e31699-d25c-4b73-9977-73bd5ed9c643)

8. The `actions/upload-artifact@v4` action seems fine for other foulders with regular files, but the **CodeCoverage** folder isn’t behaving as expected.
![image](https://github.com/user-attachments/assets/6e91c6ba-09e8-4293-833b-8a3812ec78df)

9. 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](https://github.com/user-attachments/assets/38348df2-f18c-4280-993f-0f6d81bfdf04)

10. According to the [documentation](https://game.ci/docs/github/test-runner/), 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](https://github.com/user-attachments/assets/6a3f0523-4254-41c6-be6e-cc5fd148a697)

11. The project has both **EditMode** and **PlayMode** tests.
12. The **CodeCoverage** package is installed.

Link to repository: [BaseProject ](https://github.com/vicellobre/BaseProject)

Contributor guide

Open the contributing guide

Research direction

Start with the linked game-ci GitHub Actions workflow, the game-ci test-runner documentation, and the `actions/upload-artifact@v4` steps shown in the report. Reproduce the coverage and artifact-upload sequence for EditMode and PlayMode, then document the supported configuration or confirmed cause so the generated CodeCoverage contents can be uploaded as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, unity
Domain
ci-cd, documentation, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.