问题是因为在将项目移至最新的Xcode 10和Swift 4.2之后,我们看到了一个错误:
我的快速文件如下:
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
和 gitlab-ci.yml :
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