Skip to content

Commit

Permalink
GitHub actions (#4)
Browse files Browse the repository at this point in the history
* updated packages to add supported platform as iOS 9+

* adding github actions

* adding MacOS 10.11 + as a platform so tests can be run successfully

* roll up CI all in one workflow

* adding gemfile for cocoapods

* check available runners

* adding CI badge to readme and updating iOS for lower XCode version test runs

* add simulator set up step for XCode 11 and 12

* fixing iOS versions

* create custom test devices for XCode 11 and 12 runs

* adding device type

* boot custom device and run tests on custom device

* use pbcopy and pbpaste

* list devices and try double quote

* updating minimum deployment target for test host app so it can be run on lower versions of iOS

* set iOS deployment target to 9.0+ on tests target

* adding proper job names
  • Loading branch information
gligorkot authored Dec 4, 2021
1 parent 3000614 commit a0b5e5b
Show file tree
Hide file tree
Showing 10 changed files with 263 additions and 20 deletions.
117 changes: 117 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: CI

on: pull_request

jobs:
pod-lint-10_15:
name: Pod lint
runs-on: macos-10.15

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Bundle install
run: bundle install

- name: Set up XCode Version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Pod lint
run: bundle exec pod lib lint --verbose --fail-fast --swift-version=5.5
shell: bash

test-no-iOS-host-10_15:
name: Run swift tests that don't require iOS host on MacOS 10.15
runs-on: macos-10.15
strategy:
matrix:
# latest 11 and all available versions 12
xcodeVersions: ['11.7', '12.0', '12.1', '12.2', '12.3', '12.4']

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up XCode Version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.xcodeVersions }}

- name: Run tests that don't require iOS host
run: swift test -c debug -Xswiftc -enable-testing
shell: bash

test-no-iOS-host-11:
name: Run swift tests that don't require iOS host on MacOS 11
runs-on: macos-11
strategy:
matrix:
# latest 12 and all available versions 13
xcodeVersions: ['12.5', '13.0', '13.1']

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up XCode Version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.xcodeVersions }}

- name: Run tests that don't require iOS host
run: swift test -c debug -Xswiftc -enable-testing
shell: bash

test-keychain-iOS-host-10_15-XCode11:
name: Run swift tests that require keychain entitlement on XCode 11
runs-on: macos-10.15

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up XCode Version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '11.7'

- name: Run tests that require iOS host for keychain entitlement
run: xcodebuild -project SecureStorageTestsHostApp/SecureStorageTestsHostApp.xcodeproj -scheme SecureStorageTestsHostApp -sdk iphonesimulator -destination "platform=iOS Simulator,name=iPhone 11,OS=13.7" test
shell: bash

test-keychain-iOS-host-11-XCode12:
name: Run swift tests that require keychain entitlement on XCode 12
runs-on: macos-11

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up XCode Version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '12.5'

- name: Run tests that require iOS host for keychain entitlement
run: xcodebuild -project SecureStorageTestsHostApp/SecureStorageTestsHostApp.xcodeproj -scheme SecureStorageTestsHostApp -sdk iphonesimulator -destination "platform=iOS Simulator,name=iPhone 12,OS=14.5" test
shell: bash

test-keychain-iOS-host-11-XCode13:
name: Run swift tests that require keychain entitlement on XCode 13
runs-on: macos-11

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up XCode Version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Run tests that require iOS host for keychain entitlement
run: xcodebuild -project SecureStorageTestsHostApp/SecureStorageTestsHostApp.xcodeproj -scheme SecureStorageTestsHostApp -sdk iphonesimulator -destination "platform=iOS Simulator,name=iPhone 13,OS=15.0" test
shell: bash
9 changes: 9 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

# gem "rails"

gem "cocoapods", "~> 1.10"
96 changes: 96 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.5)
rexml
activesupport (5.2.6)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
claide (1.0.3)
cocoapods (1.10.2)
addressable (~> 2.6)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.10.2)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 1.4.0, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.4.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.6.6)
nap (~> 1.0)
ruby-macho (~> 1.4)
xcodeproj (>= 1.19.0, < 2.0)
cocoapods-core (1.10.2)
activesupport (> 5.0, < 6)
addressable (~> 2.6)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.1)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
netrc (~> 0.11)
public_suffix
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (1.5.1)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.1)
cocoapods-trunk (1.6.0)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.1.9)
escape (0.0.4)
ethon (0.15.0)
ffi (>= 1.15.0)
ffi (1.15.4)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (1.8.11)
concurrent-ruby (~> 1.0)
json (2.6.1)
minitest (5.14.4)
molinillo (0.6.6)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
public_suffix (4.0.6)
rexml (3.2.5)
ruby-macho (1.4.0)
thread_safe (0.3.6)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (1.2.9)
thread_safe (~> 0.1)
xcodeproj (1.21.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)

PLATFORMS
ruby

DEPENDENCIES
cocoapods (~> 1.10)

BUNDLED WITH
2.0.2
4 changes: 4 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import PackageDescription

let package = Package(
name: "GKStorageKit",
platforms: [
.iOS(.v9),
.macOS(.v10_11)
],
products: [
.library(
name: "GKStorageKit",
Expand Down
4 changes: 4 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import PackageDescription

let package = Package(
name: "GKStorageKit",
platforms: [
.iOS(.v9),
.macOS(.v10_11)
],
products: [
.library(
name: "GKStorageKit",
Expand Down
4 changes: 4 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import PackageDescription

let package = Package(
name: "GKStorageKit",
platforms: [
.iOS(.v9),
.macOS(.v10_11)
],
products: [
.library(
name: "GKStorageKit",
Expand Down
4 changes: 4 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import PackageDescription

let package = Package(
name: "GKStorageKit",
platforms: [
.iOS(.v9),
.macOS(.v10_11)
],
products: [
.library(
name: "GKStorageKit",
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# GKStorageKit

[![CI](https://github.com/gligorkot/GKStorageKit/actions/workflows/ci.yml/badge.svg)](https://github.com/gligorkot/GKStorageKit/actions/workflows/ci.yml)

Storage package adding default implementations for three types of storages:

1. File storage - defaults to the document directory for the app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
8655DD65275B240300C1A277 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8655DD63275B240300C1A277 /* LaunchScreen.storyboard */; };
8655DD70275B240300C1A277 /* StorageKitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8655DD6F275B240300C1A277 /* StorageKitTests.swift */; };
8655DD8A275B24F600C1A277 /* SecureStorageServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8655DD89275B24F600C1A277 /* SecureStorageServiceTests.swift */; };
8655DD8F275B25C600C1A277 /* Valet in Frameworks */ = {isa = PBXBuildFile; productRef = 8655DD8E275B25C600C1A277 /* Valet */; };
8655DD95275B26E500C1A277 /* GKStorageKit in Frameworks */ = {isa = PBXBuildFile; productRef = 8655DD94275B26E500C1A277 /* GKStorageKit */; };
8655DDA4275B278A00C1A277 /* ErrorValet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8655DDA0275B278A00C1A277 /* ErrorValet.swift */; };
8655DDA5275B278A00C1A277 /* TestHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8655DDA1275B278A00C1A277 /* TestHelpers.swift */; };
Expand Down Expand Up @@ -55,7 +54,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8655DD8F275B25C600C1A277 /* Valet in Frameworks */,
8655DD95275B26E500C1A277 /* GKStorageKit in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -157,7 +155,6 @@
);
name = SecureStorageTestsHostApp;
packageProductDependencies = (
8655DD8E275B25C600C1A277 /* Valet */,
8655DD94275B26E500C1A277 /* GKStorageKit */,
);
productName = SecureStorageTestsHostApp;
Expand Down Expand Up @@ -426,6 +423,7 @@
INFOPLIST_KEY_UIMainStoryboardFile = Main;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -453,6 +451,7 @@
INFOPLIST_KEY_UIMainStoryboardFile = Main;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -474,7 +473,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -498,7 +497,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -558,11 +557,6 @@
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
8655DD8E275B25C600C1A277 /* Valet */ = {
isa = XCSwiftPackageProductDependency;
package = 8655DD8D275B25C600C1A277 /* XCRemoteSwiftPackageReference "Valet" */;
productName = Valet;
};
8655DD94275B26E500C1A277 /* GKStorageKit */ = {
isa = XCSwiftPackageProductDependency;
productName = GKStorageKit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,37 @@

import UIKit

@main
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}

// MARK: UISceneSession Lifecycle
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}

func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}

func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}


Expand Down

0 comments on commit a0b5e5b

Please sign in to comment.