2016-04-09 36 views
0

üzerinde değişen bir parametre ile bir işi defalarca yürütme Gitlab-ci'de birkaç iOS sürümü için aynı test işini yürütmek istiyorum.Gitlab-ci

Benim test iş aşağıdaki komutla oluşur:

xcodebuild test -workspace myproject.xcworkspace -scheme myScheme -destination 'platform=iOS Simulator,name=iPhone 6S,OS=9.3' 

farklı OS sürümü ve iPhone/iPad için bu komutu çalıştırmak için döngü bir tür oluşturmak mümkün mü?

  • iPhone 6/iOS 9.3
  • iPhone 6/iOS 10.0
  • iPhone 7/iOS 10.0
  • iPad Mini/iOS 8.2
  • : bir xcodebuild testi yapıyor Exemple için

    ,

  • iPad Mini/iOS 9.3 ....

Teşekkürler

cevap

-2

Kullanım aşamaları:

stages: 
    - buildForiPhone 
    - buildForiPad 

build_project: 
    stage: buildForiPhone 
    script: 
    - xcodebuild for iPhone here 
    tags: 
    - Swift 
    - iOS9 

build_project: 
    stage: buildForiPad 
    script: 
    - xcodebuild for iPad here 
    tags: 
    - Swift 
    - iOS9 

Bir bir build_project sahne ve onlar isolated bulunmaktadır. iPhone 5S ile

+0

Sorum şu: İşleri ve aşamaları kopyalamaksızın aynı işi çeşitli aygıt ve iOS sürümleri için yürütmekti. bir 'xcodebuild sına yaparak exemple için : - iPhone 6/IOS 9,3 - iPhone 6/IOS 10.0 - iPhone 7/IOS 10.0 - iPad Mini/IOS 8.2 - iPad Mini/IOS 9.3 . ... –

+0

Lütfen bu dosyayı sorunuz ve düzenleyebilirsiniz! –

0

kullanımı gitlab-ci template ve örneğin simülatörü adını içerir bir değişken, tanımlayın:

# Job 
.test_ios_job: &test_ios_job_def 
     stage: test_ios 
     script: 
      - xcodebuild test -workspace myproject.xcworkspace -scheme myScheme -destination 'platform=iOS Simulator,name=$SIMULATOR' 

# iPhone 5S 

test_ios_iPhone5S_9.1: 
     <<: *test_ios_job_def 
     variables: 
      SIMULATOR: "iPhone 5S,OS=9.1" 

test_ios_iPhone5S_10.1: 
     <<: *test_ios_job_def 
     variables: 
      SIMULATOR: "iPhone 5S,OS=10.1" 

I fastlane kullanımı tavsiye, eklenti scan kolaylaştırmak için iş:

# Job 
.test_ios_job: &test_ios_job_def 
     stage: test_ios 
     script: 
      - fastlane testios emulatorname:"$SIMULATOR" 

test_ios_iPhone5S_9.1: 
     <<: *test_ios_job_def 
     variables: 
      SIMULATOR: "iPhone 5s (9.1)" 

test_ios_iPhone5S_10.1: 
     <<: *test_ios_job_def 
     variables: 
      SIMULATOR: "iPhone 5s (10.1)" 

Fastlane iş:

lane :testios do |options| 
emulatorname = options[:emulatorname] 

#Scan 
scan(
    scheme: S_APP_SCHEME_TEST, 
    clean: true, 
    device: "#{emulatorname.to_s}", 
) 

end