Your first problem is gitlab runner is using PowerShell not the cmd console script: Start-Process "C:\Program Files\Unity\Hub\Editor\2020.1.7f1\Editor\Unity.exe" -ArgumentList "-batchmode -projectPath . -runTests -testPlatform editmode -logFile -testResults ./unit-tests.xml"
This works, in that it uses unity to run the tests and produces the test results file.
But
Gitlab doesn’t see the results file, and reports the job as a success.
This is as far as I have got following the same Mac based tutorial.
The ErrorActionPreference: Stop comes from here:; Windows PowerShell failed still marks job successful (#3194) · Issues · GitLab.org / gitlab-runner · GitLab
The 3 lines after Start-Process just open the results file and check the result attribute of the root element of the xml.
Not particularly elegant, but it works.
Pretty sure the Output-Default flag is redundant.
Hope this helps.
My next steps will be the build step and deploying to itich.io with their refinery platform.