我在 Gitlab CI 上工作,但遇到了一些与测试运行相关的问题,因为下面的命令在终端上运行并给出了完美的测试结果,但不知何故它现在在 gitlab CI 上运行。
下面是我的.gitlab-ci.yml
stages:
- build
build_project:
stage: build
script:
- xcodebuild clean -workspace "First Container.xcworkspace" -scheme "First Container" | xcpretty
- xcodebuild test -workspace "First Container.xcworkspace" -scheme "First Container" -destination 'platform=iOS Simulator,name=iPhone 8 Plus,OS=11.3' | xcpretty
tags:
- ios_11-3
- xcode_9-3
- osx_10-13-4
以下命令在我的终端上运行:
$ xcodebuild test -workspace "First Container.xcworkspace" -scheme "First Container" -destination 'platform=iOS Simulator,name=iPhone 8 Plus,OS=11.3' | xcpretty
但是当我在 CI 上运行时它卡住了,我的 gitlab-runner 没有启动 iPhone 模拟器并运行测试,构建工作正常
最佳答案
当您执行 gitlab-runner register
和稍后 gitlab-runner start
时,不要使用 sudo
。这样它将以用户模式(相对于系统模式)运行。如果您已经使用过 sudo
,请删除运行程序(从 GitLab Web UI)并重新注册。
关于iOS : gitlab-runner stuck on CI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50793941/