React Native Xcode构建在github操作中花费了很长时间

z9smfwbn  于 2023-02-24  发布在  React
关注(0)|答案(1)|浏览(138)

我已经在GitHub Actions中编写了一个iOS构建管道。但是xcodebuildBuild 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
kgsdhlau

kgsdhlau1#

您可以使用自托管运行器、缓存依赖项和缓存构建文件夹。
记住,如果你不做任何缓存,GitHub Runner总是从头开始。

相关问题