I have an iOS repo with Fastlane running unit and UI tests via GitHub Actions on my pull requests. I would like to preserve the artifacts generated, specifically the xcresults logs, and upload it to GitHub. I’ve added this to my GHA .yml
file:
- name: Archive test artifacts
uses: actions/upload-artifact@v2
with:
name: test-artifacts
path: |
~/Library/Developer/Xcode/DerivedData/MyApp/Logs/Test/*.xcresult
When tests fail, Error: Process completed with exit code 1
is returned and the above step is never done. I’d like the logs to always be uploaded regardless of tests passing or not- especially if they don’t. How can I force GHA to continue running if the previous test step failed?
For reference, that preceding GHA step is simply:
- name: Run Tests
run: |
bundle exec fastlane test
I understand it’s possible to add the fail_ci_if_error
flag set to true
on GitHub Actions (edit: it doesn’t seem to be possible to pair it with a run
command), or to set fail_build
in Fastlane’s scan
to false
, but while I would like the tests to continue to the next step and archive artifacts, I also want to the test to fail shortly after uploading the artifacts, instead of creating a false success.