代码之家  ›  专栏  ›  技术社区  ›  Bartłomiej Semańczyk

在项目被移到Xcode10和最新的wift4.2之后,如何强制CI使用最新的pods?

  •  0
  • Bartłomiej Semańczyk  · 技术社区  · 7 年前

    问题是因为我们在将project移到最新的Xcode 10和Swift 4.2之后发现了一个错误:

    我的fastfile看起来像:

    before_all do
      xcversion(version: "10.0")
    end
    
    lane :test do
      scan(scheme: SCHEME_NAME, code_coverage: true, output_directory: OUTPUT_PATH + 'tests')
      xcov(
        scheme: SCHEME_NAME, 
        workspace: WORKSPACE_FILE_PATH, 
        json_report: true, 
        markdown_report: true, 
        output_directory: OUTPUT_PATH + "coverage", 
        skip_slack: true,
        only_project_targets: true
      )
    end
    

    :

    stages:
      - build
      - test
      - deploy
      - export
    
    build:
      stage: build
      script:
        - bundle exec pod repo update
        - bundle exec pod install
        - export
      after_script:
        - rm -rf ~/Library/Developer/Xcode/Archives || true
      artifacts:
        name: "Staff_${CI_PIPELINE_ID}"
        paths:
          - Pods/*
          - Staff.xcworkspace
      when: on_success
      tags:
          - iOS
    
    test:
      stage: test
      before_script:
        - killall "Simulator" || true
      script:
        - bundle exec fastlane snapshot reset_simulators --force
        - bundle exec fastlane test
      after_script:
        - killall "Simulator" || true
        - rm -rf ~/Library/Developer/Xcode/Archives || true
      artifacts:
        name: "Staff_${CI_PIPELINE_ID}"
        paths:
          - fastlane/output/coverage
      when: on_success
      tags:
        - iOS
    

    enter image description here

    0 回复  |  直到 7 年前
    推荐文章