11version : 2.1
22
33executors :
4- job-environment :
4+ macos-executor :
5+ parameters :
6+ xcode :
7+ type : string
58 shell : /bin/bash --login -eo pipefail
69 macos :
7- xcode : 11.7.0
10+ xcode : << parameters.xcode >>
811 environment :
912 LC_ALL : en_US.UTF-8
1013 LANG : en_US.UTF-8
@@ -16,93 +19,115 @@ executors:
1619 HOMEBREW_NO_AUTO_UPDATE : 1
1720 HOMEBREW_NO_INSTALL_CLEANUP : 1
1821 FL_OUTPUT_DIR : output
22+ FASTLANE_EXPLICIT_OPEN_SIMULATOR : 2
1923
2024commands :
2125 prepare :
2226 parameters :
23- ruby :
27+ scheme :
2428 type : string
25- default : " 2.7.1p83"
26- xcode :
27- type : string
28- default : " 11.7.0"
2929 steps :
3030 - restore_cache :
3131 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
3736 - save_cache :
38- key : simplekeychain -gems-{{ checksum "Gemfile.lock" }}
37+ key : << parameters.scheme >>-v1 -gems-{{ checksum "Gemfile.lock" }}
3938 paths :
4039 - 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
4343 - restore_cache :
4444 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
4949 - save_cache :
50- key : simplekeychain- carthage-{ checksum "Cartfile.resolved" }}-<< parameters .xcode >>
50+ key : << parameters.scheme >>-v1- carthage-{{ checksum "Cartfile.resolved" }}-{{ checksum " .xcode-version" }}
5151 paths :
5252 - Carthage/Build
5353 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
8057 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
8667 - store_test_results :
8768 path : output/scan
8869 - store_artifacts :
8970 path : output
90- build-and-test-macOS :
91- executor : job-environment
71+ test-macos :
72+ parameters :
73+ scheme :
74+ type : string
9275 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 >>
98102 steps :
99103 - 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 >>
102124
103125workflows :
104126 build :
105127 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