我很难让我的项目在 travis 上构建。 它是用 Swift 4 编写的,Travis 应该支持。似乎在获取依赖项时存在问题,但是"它适用于我的机器"。 至少swift build
和swift test
,所以我很难弄清楚特拉维斯这边的问题可能是什么。
这里有没有人处理过类似的问题并知道出了什么问题?
亚姆
os:
- osx
language: swift
osx_image: xcode9
script:
- swift build
- swift test
输出
11.10s$ swift build
Cloning https://github.com/valdirunars/BigIntCompress.git
error: terminated(128): git clone --shared/Users/travis/build/valdirunars/BioSwift/.build/repositories/BigIntCompress.git-5255985680209734865/Users/travis/build/valdirunars/BioSwift/.build/checkouts/BigIntCompress.git-5255985680209734865
error: product dependency 'BigInt' not found
error: product dependency 'BigIntCompress' not found
The command "swift build" exited with 1.
0.58s$ swift test
Cloning https://github.com/valdirunars/BigIntCompress.git
error: terminated(128): git clone --shared /Users/travis/build/valdirunars/BioSwift/.build/repositories/BigIntCompress.git-5255985680209734865 /Users/travis/build/valdirunars/BioSwift/.build/checkouts/BigIntCompress.git-5255985680209734865
error: product dependency 'BigInt' not found
error: product dependency 'BigIntCompress' not found
The command "swift test" exited with 1.
Done. Your build exited with 1.
事实证明,travis 在获取依赖项时失败,当它处于script
阶段(在 .yml 中)
解决方案是添加一个install
标记,其中获取所有依赖项。
os:
- osx
language: swift
osx_image: xcode9
install: swift package update
script:
- swift build
- swift test