4
4
version : 2.1
5
5
6
6
anchors :
7
- - &test_device "iPhone Xs"
7
+ - &test_device "iPhone 14"
8
+ - &test_device_os "16.2"
8
9
- &clean_before_build true
9
- - &test_output_folder test_output
10
10
- &default_executor
11
11
macos :
12
- xcode : " 14.0 .0"
12
+ xcode : " 14.2 .0"
13
13
14
14
env :
15
15
global :
@@ -36,11 +36,18 @@ commands:
36
36
pod install --verbose
37
37
38
38
test_main_project :
39
+ parameters :
40
+ simulator :
41
+ type : string
42
+ default : *test_device
43
+ os_version :
44
+ type : string
45
+ default : *test_device_os
39
46
steps :
40
47
- checkout
41
48
- test_project_and_store_results :
42
- project : " Flow.xcodeproj "
43
- scheme : " Flow "
49
+ simulator : <<parameters.simulator>>
50
+ os_version : <<parameters.os_version>>
44
51
45
52
test_example_project :
46
53
parameters :
@@ -54,30 +61,32 @@ commands:
54
61
workspace : " Example.xcworkspace"
55
62
scheme : " Example"
56
63
path : <<parameters.path>>
57
- test_output_folder : *test_output_folder
58
64
59
65
# We introduced two separate commands for projects and workspaces because we didn't find a generic and non-confusing way to introduce
60
- # a condition to only pass either the project or the workspace environment argument to the fastlane scan
66
+ # a condition to only pass either the project or the workspace environment argument to the test output
61
67
test_project_and_store_results :
62
68
description : " Builds and tests a project and then stores the results of the tests as artifacts and test results report"
63
69
parameters :
64
- project :
70
+ simulator :
65
71
type : string
66
- scheme :
72
+ default : *test_device
73
+ os_version :
67
74
type : string
75
+ default : *test_device_os
68
76
steps :
69
77
- run :
70
- command : fastlane scan
71
- environment :
72
- SCAN_PROJECT : <<parameters.project>>
73
- SCAN_SCHEME : <<parameters.scheme>>
74
- SCAN_DEVICE : *test_device
75
- SCAN_CLEAN : *clean_before_build
78
+ name : Run tests on iOS <<parameters.os_version>>
79
+ command : |
80
+ xcodebuild -scheme Flow \
81
+ -project Flow.xcodeproj \
82
+ -destination "platform=iOS Simulator,OS=<<parameters.os_version>>,name=<<parameters.simulator>>" \
83
+ build test \
84
+ | xcpretty --report junit --output 'test_output/report.junit'
76
85
- store_artifacts : # This will by default store an html and junit file as artifacts (See "Artifacts" tab in CircleCI report)
77
- path : *test_output_folder # test_output is the default temporary folder for fastlane scan output
78
- destination : *test_output_folder # This will create a sub structure in the artifacts section in CircleCI
86
+ path : test_output # test_output is the default temporary folder for test output
87
+ destination : test_output # This will create a sub structure in the artifacts section in CircleCI
79
88
- store_test_results : # This will store the test results so you can then see them in the "Test Summary" tab in CircleCI report
80
- path : *test_output_folder
89
+ path : test_output
81
90
82
91
test_workspace_and_store_results :
83
92
description : " Builds and tests a workspace and then stores the results of the tests as artifacts and test results report"
@@ -88,23 +97,27 @@ commands:
88
97
type : string
89
98
path :
90
99
type : string
91
- test_output_folder :
100
+ simulator :
92
101
type : string
102
+ default : *test_device
103
+ os_version :
104
+ type : string
105
+ default : *test_device_os
93
106
steps :
94
107
- run :
95
- command : |
108
+ name : Run examples
109
+ command : |
96
110
cd <<parameters.path>>
97
- fastlane scan
98
- environment :
99
- SCAN_WORKSPACE : <<parameters.workspace>>
100
- SCAN_SCHEME : <<parameters.scheme>>
101
- SCAN_DEVICE : *test_device
102
- SCAN_CLEAN : *clean_before_build
111
+ xcodebuild -workspace <<parameters.workspace>> \
112
+ -scheme <<parameters.scheme>> \
113
+ -destination "platform=iOS Simulator,OS=<<parameters.os_version>>,name=<<parameters.simulator>>" \
114
+ build test \
115
+ | xcpretty --report junit --output 'test_output/report.junit'
103
116
- store_artifacts : # This will by default store an html and junit file as artifacts (See "Artifacts" tab in CircleCI report)
104
- path : <<parameters.path>>/<<parameters.test_output_folder>> # test_output is the default temporary folder for fastlane scan output
105
- destination : <<parameters.test_output_folder>> # This will create a sub structure in the artifacts section in CircleCI
117
+ path : <<parameters.path>>/test_output # test_output is the default temporary folder for test output
118
+ destination : test_output # This will create a sub structure in the artifacts section in CircleCI
106
119
- store_test_results : # This will store the test results so you can then see them in the "Test Summary" tab in CircleCI report
107
- path : <<parameters.path>>/<<parameters.test_output_folder>>
120
+ path : <<parameters.path>>/test_output
108
121
109
122
jobs :
110
123
swiftlint :
@@ -136,7 +149,9 @@ jobs:
136
149
macos :
137
150
xcode : " 13.0.0"
138
151
steps :
139
- - test_main_project
152
+ - test_main_project :
153
+ simulator : " iPhone 13"
154
+ os_version : " 15.0"
140
155
141
156
test-xcode14-ios16 :
142
157
<< : *default_executor
0 commit comments