Travis CI不使用主分支缓存

时间:2019-01-19 16:23:20

标签: travis-ci carthage

我正在使用 Carthage 作为我的项目包管理器和 Travis CI

我面临的问题是昨天,Travis确实从master分支创建了一个缓存,如下图所示,一切正常。

enter image description here

但是,今天,当我确实切换到另一个分支并推送了对它的更改时,Travis并未从master分支中获取它已建立的缓存。相反,它为我创建的该分支创建了一个新的cache。我希望它始终使用主缓存,并且不要尝试为我从cache创建的每个分支创建一个master

我应该如何实现呢?

源文件: .travis.yml

#Xcode 9.4 image default contents: https://blog.travis-ci.com/2018-07-19-xcode9-4-default-announce
#Need to create: "if: branch = master" and "if: branch = development"

language: swift
os: osx
osx_image: xcode10
sudo: required

cache:
directories:
- Carthage

before_install:
# Update Homebrew
- brew update
# Clean install Carthage
- brew uninstall --force carthage
- brew install carthage
- brew cask install fastlane
# Provide travis machines with github access
- echo -e "machine github.com\n  login $CI_USER_TOKEN" >> ~/.netrc
# Print script to avoid travis_wait from stopping build process
- while sleep 480m; do echo "=====[ $SECONDS seconds, Carthage still building... ]====="; done &
# Carthage Bootstrap
- carthage bootstrap --cache-builds --platform ios,watchos --no-use-binaries
# Stop Print script
- kill %1

script:
- fastlane beta

0 个答案:

没有答案