1
1
version : 2.1
2
2
3
3
executors :
4
- job-environment :
4
+ macos-executor :
5
+ parameters :
6
+ xcode :
7
+ type : string
5
8
shell : /bin/bash --login -eo pipefail
6
9
macos :
7
- xcode : 11.7.0
10
+ xcode : << parameters.xcode >>
8
11
environment :
9
12
LC_ALL : en_US.UTF-8
10
13
LANG : en_US.UTF-8
@@ -16,93 +19,115 @@ executors:
16
19
HOMEBREW_NO_AUTO_UPDATE : 1
17
20
HOMEBREW_NO_INSTALL_CLEANUP : 1
18
21
FL_OUTPUT_DIR : output
22
+ FASTLANE_EXPLICIT_OPEN_SIMULATOR : 2
19
23
20
24
commands :
21
25
prepare :
22
26
parameters :
23
- ruby :
27
+ scheme :
24
28
type : string
25
- default : " 2.7.1p83"
26
- xcode :
27
- type : string
28
- default : " 11.7.0"
29
29
steps :
30
30
- restore_cache :
31
31
keys :
32
- - simplekeychain-gems-{{ checksum "Gemfile.lock" }}
33
- - simplekeychain-gems-
34
- - run : |
35
- echo "ruby-<< parameters.ruby >>" > ~/.ruby-version
36
- bundle check || bundle install --without=development
32
+ - << parameters.scheme >>-v1-gems-{{ checksum "Gemfile.lock" }}
33
+ - run :
34
+ name : Install gems
35
+ command : bundle check || bundle install --without=development
37
36
- save_cache :
38
- key : simplekeychain -gems-{{ checksum "Gemfile.lock" }}
37
+ key : << parameters.scheme >>-v1 -gems-{{ checksum "Gemfile.lock" }}
39
38
paths :
40
39
- vendor/bundle
41
- - run : |
42
- grep -lR "shouldUseLaunchSchemeArgsEnv" *.* --null | xargs -0 sed -i '' -e 's/shouldUseLaunchSchemeArgsEnv = "YES"/shouldUseLaunchSchemeArgsEnv = "YES" codeCoverageEnabled = "YES"/g'
40
+ - run :
41
+ name : Save Xcode version
42
+ command : xcodebuild -version | tee .xcode-version
43
43
- restore_cache :
44
44
keys :
45
- - simplekeychain- carthage-{ checksum "Cartfile.resolved" }}-<< parameters .xcode >>
46
- - simplekeychain-carthage-{ checksum "Cartfile.resolved" }}
47
- - simplekeychain-carthage-
48
- - run : carthage bootstrap --no-use-binaries --cache-builds
45
+ - << parameters.scheme >>-v1- carthage-{{ checksum "Cartfile.resolved" }}-{{ checksum " .xcode-version" }}
46
+ - run :
47
+ name : Install dependencies
48
+ command : carthage bootstrap --use-xcframeworks --no-use-binaries --cache-builds
49
49
- save_cache :
50
- key : simplekeychain- carthage-{ checksum "Cartfile.resolved" }}-<< parameters .xcode >>
50
+ key : << parameters.scheme >>-v1- carthage-{{ checksum "Cartfile.resolved" }}-{{ checksum " .xcode-version" }}
51
51
paths :
52
52
- Carthage/Build
53
53
test-ios :
54
- steps :
55
- - run : bundle exec fastlane ios ci
56
- pod-lint :
57
- steps :
58
- - run : bundle exec fastlane ios pod_lint
59
- send-coverage-report :
60
- steps :
61
- - run : bash <(curl -s https://codecov.io/bash) -J 'SimpleKeychain'
62
- test-macos :
63
- steps :
64
- - run : |
65
- security create-keychain -p circle cikeychain
66
- security list-keychains -d user -s "/Users/distiller/Library/Keychains/xcode.keychain-db" /Users/distiller/Library/Keychains/cikeychain-db
67
- security default-keychain -s /Users/distiller/Library/Keychains/cikeychain-db
68
- security unlock-keychain -p circle "/Users/distiller/Library/Keychains/cikeychain-db"
69
- xcodebuild test -scheme SimpleKeychain-OSX -destination 'platform=macOS,arch=x86_64' | xcpretty
70
- swift test
71
- test-tvos :
72
- steps :
73
- - run : xcodebuild test -scheme 'SimpleKeychain-tvOS' -destination 'platform=tvOS Simulator,name=Apple TV' | xcpretty
74
-
75
- jobs :
76
- build-and-test-iOS :
77
- executor : job-environment
78
- environment :
79
- FASTLANE_EXPLICIT_OPEN_SIMULATOR : 2
54
+ parameters :
55
+ scheme :
56
+ type : string
80
57
steps :
81
- - checkout
82
- - prepare
83
- - test-ios
84
- - send-coverage-report
85
- - pod-lint
58
+ - run :
59
+ name : Run iOS tests
60
+ command : bundle exec fastlane ios ci
61
+ - run :
62
+ name : Upload coverage report
63
+ command : bash <(curl -s https://codecov.io/bash) -J '<< parameters.scheme >>'
64
+ - run :
65
+ name : Run pod lib lint
66
+ command : bundle exec fastlane ios pod_lint
86
67
- store_test_results :
87
68
path : output/scan
88
69
- store_artifacts :
89
70
path : output
90
- build-and-test-macOS :
91
- executor : job-environment
71
+ test-macos :
72
+ parameters :
73
+ scheme :
74
+ type : string
92
75
steps :
93
- - checkout
94
- - prepare
95
- - test-macos
96
- build-and-test-tvOS :
97
- executor : job-environment
76
+ - run :
77
+ name : Run macOS tests
78
+ command : |
79
+ xcodebuild test -scheme << parameters.scheme >>-OSX -destination 'platform=macOS,arch=x86_64' | xcpretty
80
+ swift test
81
+ test-tvos :
82
+ parameters :
83
+ scheme :
84
+ type : string
85
+ steps :
86
+ - run :
87
+ name : Run tvOS tests
88
+ command : xcodebuild test -scheme << parameters.scheme >>-tvOS -destination 'platform=tvOS Simulator,name=Apple TV' | xcpretty
89
+
90
+ jobs :
91
+ build-and-test :
92
+ parameters :
93
+ platform :
94
+ type : string
95
+ xcode :
96
+ type : string
97
+ scheme :
98
+ type : string
99
+ executor :
100
+ name : macos-executor
101
+ xcode : << parameters.xcode >>
98
102
steps :
99
103
- checkout
100
- - prepare
101
- - test-tvos
104
+ - prepare :
105
+ scheme : << parameters.scheme >>
106
+ - when :
107
+ condition :
108
+ equal : [ios, << parameters.platform >>]
109
+ steps :
110
+ - test-ios :
111
+ scheme : << parameters.scheme >>
112
+ - when :
113
+ condition :
114
+ equal : [macos, << parameters.platform >>]
115
+ steps :
116
+ - test-macos :
117
+ scheme : << parameters.scheme >>
118
+ - when :
119
+ condition :
120
+ equal : [tvos, << parameters.platform >>]
121
+ steps :
122
+ - test-tvos :
123
+ scheme : << parameters.scheme >>
102
124
103
125
workflows :
104
126
build :
105
127
jobs :
106
- - build-and-test-iOS
107
- - build-and-test-macOS
108
- - build-and-test-tvOS
128
+ - build-and-test :
129
+ scheme : " SimpleKeychain"
130
+ matrix :
131
+ parameters :
132
+ platform : ["ios", "macos", "tvos"]
133
+ xcode : ["13.0.0", "12.5.1"]
0 commit comments