小编Uni*_*eas的帖子

如何修复 GitHub Actions 中的 xcodebuild 错误

我正在尝试使用 GitHub Actions 在 Github 中为我的私有 Swift 项目设置 CI。我使用了 Github 提供的标准 swift.yml 模板并进行了一些修改。这是文件ci.yml

name: Swift

on: [push]

jobs:
  build:

    runs-on: macOS-latest

    steps:
    - uses: actions/checkout@v1
    - name: Run tests
      run: xcodebuild -project 'MyApp.xcodeproj' -scheme 'MyApp' -destination 'platform=iOS Simulator,name=iPhone 11 Pro Max,OS=13.2' clean test
    - name: Build App
      run: xcodebuild -project 'MyApp.xcodeproj' -scheme 'MyApp' -destination 'generic/platform=iOS' -configuration Release build CODE_SIGNING_ALLOWED=NO
Run Code Online (Sandbox Code Playgroud)

当我将新版本推送到存储库时,操作会触发,但测试失败。

xcodebuild -project 'MyApp.xcodeproj' -scheme 'MyApp' -destination 'platform=iOS Simulator,name=iPhone 11 Pro Max,OS=latest' clean test
Run Code Online (Sandbox Code Playgroud)

我在本地运行并且所有测试都通过了。在 GitHub Actions 上,我遇到了此错误

Set up …
Run Code Online (Sandbox Code Playgroud)

continuous-integration xcodebuild ios swift github-actions

6
推荐指数
1
解决办法
3923
查看次数