-
Hi, I’m new to github actions. I’m trying to set it up to run the unit tests for my iOS-only Swift package. All of my tests involving writing txt files to the simulators documents directory are failing inside github actions, but working fine locally and working fine in a local test iOS project. The error getting printed to the console is: “The file xxxxx doesn’t exist”. The file wouldn’t exist because the code is trying to create it. Does github actions have any kind of restrictions in accessing folders on simulators for writing data? The file URL I was trying to write to with
Also is there anyway to access log files generated by xcode? When a test fails i’d love to just download the .xcresult file and open in locally. But I can’t see a way to do that. Is there anyway to access them, or actions to save them somewhere else? Path would be something like:
Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Seems the issue was the documents directory is not created by default when using GHA, and the error from xcode is super misleading. I changed my code to use:
Instead and it works across the board. As for the logs, yes there are github actions available to upload logs as artifacts, this needs to be done for anything you want to save. There is a great github action that makes all of this much easier. Will auto upload logs during a failure and can be turned on to always upload if you want to see coverage for tests:
|
Beta Was this translation helpful? Give feedback.
Seems the issue was the documents directory is not created by default when using GHA, and the error from xcode is super misleading.
I changed my code to use:
Instead and it works across the board. As for the logs, yes there are github actions available to upload logs as artifacts, this needs to be done for anything you want to save. There is a great github action that makes all of this much easier. Will auto upload logs during a failure and can be turned on to always upload if you want to see coverage for tests: