Skip to content

Commit

Permalink
Merge pull request #117 from auth0/chore/xcframeworks
Browse files Browse the repository at this point in the history
Migrate to XCFrameworks [SDK-2802]
  • Loading branch information
Steve Hobbs authored Sep 30, 2021
2 parents e3cae14 + e41bf49 commit 1864e72
Show file tree
Hide file tree
Showing 8 changed files with 261 additions and 223 deletions.
151 changes: 88 additions & 63 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
version: 2.1

executors:
job-environment:
macos-executor:
parameters:
xcode:
type: string
shell: /bin/bash --login -eo pipefail
macos:
xcode: 11.7.0
xcode: << parameters.xcode >>
environment:
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
Expand All @@ -16,93 +19,115 @@ executors:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
FL_OUTPUT_DIR: output
FASTLANE_EXPLICIT_OPEN_SIMULATOR: 2

commands:
prepare:
parameters:
ruby:
scheme:
type: string
default: "2.7.1p83"
xcode:
type: string
default: "11.7.0"
steps:
- restore_cache:
keys:
- simplekeychain-gems-{{ checksum "Gemfile.lock" }}
- simplekeychain-gems-
- run: |
echo "ruby-<< parameters.ruby >>" > ~/.ruby-version
bundle check || bundle install --without=development
- << parameters.scheme >>-v1-gems-{{ checksum "Gemfile.lock" }}
- run:
name: Install gems
command: bundle check || bundle install --without=development
- save_cache:
key: simplekeychain-gems-{{ checksum "Gemfile.lock" }}
key: << parameters.scheme >>-v1-gems-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
- run: |
grep -lR "shouldUseLaunchSchemeArgsEnv" *.* --null | xargs -0 sed -i '' -e 's/shouldUseLaunchSchemeArgsEnv = "YES"/shouldUseLaunchSchemeArgsEnv = "YES" codeCoverageEnabled = "YES"/g'
- run:
name: Save Xcode version
command: xcodebuild -version | tee .xcode-version
- restore_cache:
keys:
- simplekeychain-carthage-{ checksum "Cartfile.resolved" }}-<< parameters.xcode >>
- simplekeychain-carthage-{ checksum "Cartfile.resolved" }}
- simplekeychain-carthage-
- run: carthage bootstrap --no-use-binaries --cache-builds
- << parameters.scheme >>-v1-carthage-{{ checksum "Cartfile.resolved" }}-{{ checksum ".xcode-version" }}
- run:
name: Install dependencies
command: carthage bootstrap --use-xcframeworks --no-use-binaries --cache-builds
- save_cache:
key: simplekeychain-carthage-{ checksum "Cartfile.resolved" }}-<< parameters.xcode >>
key: << parameters.scheme >>-v1-carthage-{{ checksum "Cartfile.resolved" }}-{{ checksum ".xcode-version" }}
paths:
- Carthage/Build
test-ios:
steps:
- run: bundle exec fastlane ios ci
pod-lint:
steps:
- run: bundle exec fastlane ios pod_lint
send-coverage-report:
steps:
- run: bash <(curl -s https://codecov.io/bash) -J 'SimpleKeychain'
test-macos:
steps:
- run: |
security create-keychain -p circle cikeychain
security list-keychains -d user -s "/Users/distiller/Library/Keychains/xcode.keychain-db" /Users/distiller/Library/Keychains/cikeychain-db
security default-keychain -s /Users/distiller/Library/Keychains/cikeychain-db
security unlock-keychain -p circle "/Users/distiller/Library/Keychains/cikeychain-db"
xcodebuild test -scheme SimpleKeychain-OSX -destination 'platform=macOS,arch=x86_64' | xcpretty
swift test
test-tvos:
steps:
- run: xcodebuild test -scheme 'SimpleKeychain-tvOS' -destination 'platform=tvOS Simulator,name=Apple TV' | xcpretty

jobs:
build-and-test-iOS:
executor: job-environment
environment:
FASTLANE_EXPLICIT_OPEN_SIMULATOR: 2
parameters:
scheme:
type: string
steps:
- checkout
- prepare
- test-ios
- send-coverage-report
- pod-lint
- run:
name: Run iOS tests
command: bundle exec fastlane ios ci
- run:
name: Upload coverage report
command: bash <(curl -s https://codecov.io/bash) -J '<< parameters.scheme >>'
- run:
name: Run pod lib lint
command: bundle exec fastlane ios pod_lint
- store_test_results:
path: output/scan
- store_artifacts:
path: output
build-and-test-macOS:
executor: job-environment
test-macos:
parameters:
scheme:
type: string
steps:
- checkout
- prepare
- test-macos
build-and-test-tvOS:
executor: job-environment
- run:
name: Run macOS tests
command: |
xcodebuild test -scheme << parameters.scheme >>-OSX -destination 'platform=macOS,arch=x86_64' | xcpretty
swift test
test-tvos:
parameters:
scheme:
type: string
steps:
- run:
name: Run tvOS tests
command: xcodebuild test -scheme << parameters.scheme >>-tvOS -destination 'platform=tvOS Simulator,name=Apple TV' | xcpretty

jobs:
build-and-test:
parameters:
platform:
type: string
xcode:
type: string
scheme:
type: string
executor:
name: macos-executor
xcode: << parameters.xcode >>
steps:
- checkout
- prepare
- test-tvos
- prepare:
scheme: << parameters.scheme >>
- when:
condition:
equal: [ios, << parameters.platform >>]
steps:
- test-ios:
scheme: << parameters.scheme >>
- when:
condition:
equal: [macos, << parameters.platform >>]
steps:
- test-macos:
scheme: << parameters.scheme >>
- when:
condition:
equal: [tvos, << parameters.platform >>]
steps:
- test-tvos:
scheme: << parameters.scheme >>

workflows:
build:
jobs:
- build-and-test-iOS
- build-and-test-macOS
- build-and-test-tvOS
- build-and-test:
scheme: "SimpleKeychain"
matrix:
parameters:
platform: ["ios", "macos", "tvos"]
xcode: ["13.0.0", "12.5.1"]
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
source 'https://rubygems.org'

gem 'cocoapods'
gem 'xcpretty'
gem 'fastlane'
gem 'cocoapods'

plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ A wrapper to make it really easy to deal with iOS Keychain and store your user's
## Requirements

- iOS 9.0+ / macOS 10.11+ / tvOS 9.0+ / watchOS 2.0+
- Xcode 11.4+ / 12.x
- Xcode 12.x / 13.x
- Swift 4.x / 5.x

## Installation
Expand All @@ -54,7 +54,7 @@ If you are using [Carthage](https://github.com/Carthage/Carthage), add the follo
github "auth0/SimpleKeychain"
```

Then run `carthage bootstrap`.
Then run `carthage bootstrap --use-xcframeworks`.

> For more information about Carthage usage, check [their official documentation](https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos).
Expand Down
Loading

0 comments on commit 1864e72

Please sign in to comment.