【问题标题】:Carthage cache on Travis CITravis CI 上的 Carthage 缓存
【发布时间】:2023-04-07 20:27:01
【问题描述】:

我正在为 iOS 项目使用 Travis CI。我的 .travis.yml 文件如下。

language: objective-c
osx_image: xcode9.2

cache:
  directories:
  - Carthage

env:
  #environment variables
  global:
    - LANG=en_US.UTF-8
    - LC_ALL=en_US.UTF-8
    - PROJECT_NAME="MyProject.xcodeproj"
    - SCHEME_IOS_FRAMEWORK="Framework_iOS"
    - SCHEME_TVOS_FRAMEWORK="Framework_tvOS"
    - IOS_SDK=iphonesimulator11.2
    - TVOS_SDK=appletvsimulator11.2
  matrix:
    - DESTINATION="OS=11.2,name=iPhone X" SCHEME="$SCHEME_IOS_FRAMEWORK" SDK="$IOS_SDK"
    - DESTINATION="OS=11.0,name=Apple TV 1080p" SCHEME="$SCHEME_TVOS_FRAMEWORK" SDK="$TVOS_SDK"

before_install:
  - brew install carthage || true
  - brew outdated carthage || brew upgrade carthage
  - gem install xcpretty-travis-formatter --no-rdoc --no-ri --no-document --quiet

before_script:
  # bootstrap the dependencies for the project
  - carthage bootstrap --platform iOS --no-use-binaries --cache-builds
  - carthage bootstrap --platform tvOS --no-use-binaries --cache-builds

script:
  - set -o pipefail
  - xcodebuild clean test -project "$PROJECT_NAME" -scheme "$SCHEME" -destination "$DESTINATION" -sdk "$SDK" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO | xcpretty -f `xcpretty-travis-formatter`

我有 2 个方案,一个用于 iOS 和其他 tvOS。构建在 Travis 中通过,但需要 18-20 分钟 以下来自Trvais日志

在 Travis 中优化构建时间的任何解决方法?我刚开始学习持续集成。 Travis 的 YML 脚本有错误吗?

【问题讨论】:

    标签: ios swift macos travis-ci carthage


    【解决方案1】:

    只需在您当前的缓存配置旁边使用carthage update --cache-builds。第二次运行后它对我有用。

    【讨论】:

    • 而不是使用 carthage bootstrap?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-23
    • 2013-10-25
    • 1970-01-01
    • 1970-01-01
    • 2016-02-07
    相关资源
    最近更新 更多