我已经在GitHub Actions中编写了一个iOS构建管道。但是xcodebuild
(Build iOS (debug)
)步骤需要大约25分钟才能完成。有什么方法可以缩短构建时间吗?
工作流程如下:
name: iOS
on: [push, pull_request]
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- run: npm ci
- run: xcode-select -p
- run: pod install
working-directory: ios
name: Install pod dependencies
- name: Build iOS (debug)
run: "xcodebuild -workspace ios/AwesomeProject.xcworkspace -scheme AwesomeProject clean archive -sdk iphoneos -configuration Debug -UseModernBuildSystem=NO -archivePath $PWD/AwesomeProject CODE_SIGNING_ALLOWED=NO"
- name: Compress .xcarchive
run: zip -r -9 AwesomeProject.xcarchive.zip $PWD/AwesomeProject.xcarchive/
- uses: actions/upload-artifact@v2
with:
name: ios-xarchive
path: AwesomeProject.xcarchive.zip
1条答案
按热度按时间kgsdhlau1#
您可以使用自托管运行器、缓存依赖项和缓存构建文件夹。
记住,如果你不做任何缓存,GitHub Runner总是从头开始。