game-ci / unity-test-runner

Run tests for any Unity project
https://github.com/marketplace/actions/unity-test-runner
MIT License
206 stars 135 forks source link

cannot access '/github/workspace/CodeCoverage': No such file or directory #252

Closed hannesdelbeke closed 8 months ago

hannesdelbeke commented 8 months ago

Bug description

###########################
#    COMBINE_RESULTS Results    #
###########################

chmod: cannot access '/github/workspace/CodeCoverage': No such file or directory
Changing to "/github/workspace/_activate-license" directory.
/github/workspace/_activate-license /github/workspace
/github/workspace

###########################
#         Failure         #
###########################

Please note that the exit code is not very descriptive.
Most likely it will not help you solve the issue.

To find the reason for failure: please search for errors in the log above.

Error: The process '/usr/bin/docker' failed with exit code 1

https://github.com/Anthogonyst/Synesthesia/actions/runs/7201350807/job/19617259886

How to reproduce

i just make a buid. and it fails on test. i m not sure if the project actually has tests or not.

Additional details

GabLeRoux commented 8 months ago

There's a few problems with the linked repository:

  1. The Library folder is tracked in git, it shouldn't be.

Make sure you use proper .gitignore and then get rid of files that should be ignored:

git rm -rf . --cached && git add .
git commit -m "Remove files that should be ignored"
git push
  1. The project doesn't have tests

You're trying to run unity-test-runner to execute Playmode and Editmode tests, but there are none in the project. If you're only looking to automate the builds, you can delete the parts in the yaml workflow that executes the tests.

  1. I recommend using the parallel workflow example from our docs instead of running everything sequentially. This might cause troubles with excessive space use by downloading multiple docker images on a single action run.

See this example here:

https://game.ci/docs/github/getting-started#parallel-execution-of-tests-and-builds

I actually tried on your project myself since it is open source 👍 and I managed to get the test runner to pass using the parallel example (even tho it didn't find tests).

CleanShot 2023-12-13 at 17 00 45

I actually upgraded to unity 2022.3.4f1 (mainly because that's a version I had installed locally) and deleted the files that shouldn't be tracked and it worked.

While reading the logs, I still found a notable issue:

Make sure videos are in supported formats. mp4 is not supported on linux when building.

Updating Assets/Synesthesia/Sprites/ezgif-1-767204b7bd69.mp4 - GUID: fc80bd6842726b24684f0f1cbb327abc... Error while reading movie: /github/workspace/Assets/Synesthesia/Sprites/ezgif-1-767204b7bd69.mp4

(Filename: /home/builduser/buildslave/unity/build/Editor/Src/Video/VideoClipTranscode.cpp Line: 254)

VideoClip import error for Assets/Synesthesia/Sprites/ezgif-1-767204b7bd69.mp4

(Filename: /home/builduser/buildslave/unity/build/Editor/Src/AssetPipeline/VideoClipImporter.cpp Line: 341)

In other words, unity failed to import Synesthesia/Sprites/ezgif-1-767204b7bd69.mp4 in the CI. Please note that the runners building the project is actually running on Linux. The following official documentation applies:

https://docs.unity3d.com/Manual/VideoSources-FileCompatibility.html

CleanShot 2023-12-13 at 17 16 30

So you might have to convert the videos to a supported linux format or try to build from a Windows runner instead.

GabLeRoux commented 8 months ago

Here's a PR that showcases the fixes: https://github.com/Anthogonyst/Synesthesia/pull/1

Note: I did not fix the video and I did not try the generated build.

Link to successful run:
https://github.com/GabLeRoux/Synesthesia/actions/runs/7201643599

GabLeRoux commented 8 months ago

I'm closing this as I demonstrated in related pull-request that there is no problem with the CI. Don't hesitate to create other issues, reply here or chat on our discord server.

Good luck :)

hannesdelbeke commented 8 months ago

Thanks for the lightning fast feedback on this 🤯

Anthogonyst commented 8 months ago

This is amazing. Thank you so much!