-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
94 lines (73 loc) · 2.01 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
default:
before_script:
- cd Marvel\ Characters
cache:
key: ExternalDependencies
paths:
- Marvel\ Characters/Carthage/Checkouts
- Marvel\ Characters/Carthage/Build/*.version
- Marvel\ Characters/Carthage/Build/iOS/*.framework
- Marvel\ Characters/Pods
- Marvel\ Characters/DerivedData/Build/Products
stages:
- setup
- build
- test
Prepare:
stage: setup
script:
- carthage bootstrap --platform iOS --cache-builds
- pod install
- xcodebuild clean
retry:
max: 2
only:
refs:
- tags
- merge_requests
- branches
tags:
- macOS
- iPhone6_simulator_available
BuildForTesting:
stage: build
script:
- mkdir -p DerivedData
- xcodebuild build-for-testing -workspace "Marvel Characters.xcworkspace" -scheme "Marvel Characters" -derivedDataPath ./DerivedData CODE_SIGNING_ALLOWED=NO -enableCodeCoverage YES -destination "platform=iOS Simulator,name=iPhone 6" | tee ./DerivedData/xcodebuild.log | xcpretty --color
only:
refs:
- tags
- merge_requests
- branches
artifacts:
when: on_failure
paths:
- Marvel\ Characters/DerivedData/xcodebuild.log
dependencies:
- Prepare
tags:
- macOS
- iPhone6_simulator_available
Test:
stage: test
script:
- xcodebuild test-without-building -workspace "Marvel Characters.xcworkspace" -scheme "Marvel Characters" -derivedDataPath ./DerivedData CODE_SIGNING_ALLOWED=NO -enableCodeCoverage YES -destination "platform=iOS Simulator,name=iPhone 6" | xcpretty --color -r junit
- xcrun xccov view DerivedData/Logs/Test/*.xcresult/*_Test/*.xccovreport | grep 'Marvel Characters.app' | head -1 | perl -pe 's/.+?(\d+\.\d+%).+/\1/'
coverage: '/\d+\.\d+%/'
retry:
max: 1
artifacts:
when: on_success
reports:
junit: Marvel\ Characters/build/reports/junit.xml
only:
refs:
- develop
- master
- tags
- merge_requests
dependencies:
- BuildForTesting
tags:
- macOS
- iPhone6_simulator_available