Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update CI config to run on macOS Big Sur #16

Merged
merged 3 commits into from
Aug 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 28 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# https://github.com/actions/virtual-environments

name: GitHub Actions

on:
pull_request:
push:
Expand All @@ -9,25 +10,35 @@ on:
workflow_dispatch:
branches:
- main

jobs:
test:
name: Test
runs-on: macos-10.15
runs-on: macos-11
strategy:
matrix:
xcode_version:
- 12.4
# Should revisit these versions once Big sur will be available.
# - 12.5.1
# - 13.0
- 12.4.0
- 12.5.1
- 13.0.0
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode_version }}.app
OLD_XCODE_APP: /Applications/Xcode_11.7.app
OLD_TARGET_OS: 13.7
OLD_DEVICE: iPhone 11 Pro
OLD_RUNTIME_NAME: com.apple.CoreSimulator.SimRuntime.iOS-13-7
steps:
- uses: actions/checkout@v2
- name: Show environments
run: |
swift --version
xcodebuild -version
- name: Prepare old OS simulator
run: |
sudo mkdir -p /Library/Developer/CoreSimulator/Profiles/Runtimes
sudo ln -s $OLD_XCODE_APP/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ $OLD_TARGET_OS.simruntime
xcrun simctl list runtimes
xcrun simctl list devices $OLD_TARGET_OS
- name: Test for macOS
run: xcodebuild test -scheme Hooks -destination "platform=macOS"
- name: Test for iOS
Expand All @@ -36,15 +47,21 @@ jobs:
run: xcodebuild test -scheme Hooks -destination "platform=tvOS Simulator,name=Apple TV"
- name: Build for watchOS
run: WATCHOS=true xcodebuild build -scheme Hooks -destination "platform=watchOS Simulator,name=Apple Watch Series 6 - 44mm"
- name: Test for old iOS
run: xcodebuild test -scheme Hooks -destination "platform=iOS Simulator,name=$OLD_DEVICE,OS=$OLD_TARGET_OS"
- name: UI Test Todo
working-directory: Examples
run: xcodebuild test -scheme Todo-UITests -destination "platform=iOS Simulator,name=$OLD_DEVICE,OS=$OLD_TARGET_OS"

build-examples:
name: Build examples
runs-on: macos-10.15
runs-on: macos-11
strategy:
matrix:
xcode_version:
- 12.5.1
env:
DEVELOPER_DIR: /Applications/Xcode_12.4.app
OLD_XCODE_APP: /Applications/Xcode_11.7.app
OLD_TARGET_OS: 13.7
OLD_RUNTIME_NAME: com.apple.CoreSimulator.SimRuntime.iOS-13-7
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode_version }}.app
defaults:
run:
working-directory: Examples
Expand All @@ -54,19 +71,11 @@ jobs:
run: |
swift --version
xcodebuild -version
- name: Prepare old OS simulator
run: |
sudo mkdir -p /Library/Developer/CoreSimulator/Profiles/Runtimes
sudo ln -s $OLD_XCODE_APP/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ $OLD_TARGET_OS.simruntime
xcrun simctl list runtimes
xcrun simctl list devices $OLD_TARGET_OS
- name: Build TheMovieDB
run: xcodebuild build -scheme TheMovieDB-MVVM -destination "platform=iOS Simulator,name=iPhone 12 Pro"
- name: Test TheMovieDB
run: xcodebuild test -scheme TheMovieDB-MVVM-Tests -destination "platform=iOS Simulator,name=iPhone 12 Pro"
- name: Build Basic
run: xcodebuild build -scheme BasicUsage -destination "platform=iOS Simulator,name=iPhone 12 Pro"
- name: Build Legacy
- name: Build Todo
run: xcodebuild build -scheme Todo -destination "platform=iOS Simulator,name=iPhone 12 Pro"
- name: Build Legacy with iOS13
run: xcodebuild build -scheme Todo -destination "platform=iOS Simulator,name=iPhone 11 Pro,OS=$OLD_TARGET_OS"
100 changes: 100 additions & 0 deletions Examples/Examples.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
9A21001120896DD74A77368A /* TodoPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = A01793F321BFB68D18E27818 /* TodoPage.swift */; };
A9E31B44F7E151BD8F7A3CD8 /* Hooks in Frameworks */ = {isa = PBXBuildFile; productRef = FD40812DAB4C1F5B720757F7 /* Hooks */; };
C078F002FB29736B800B3774 /* CounterPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94D8757F265C5526C297EFDB /* CounterPage.swift */; };
DCDC2A61345B88907286B20C /* SimpleUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03B06DA75E791F7A1E0B6542 /* SimpleUITests.swift */; };
E404ADC8590A7823470D6488 /* UseMovieImageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A76A9D3B40580BCF4FEE209 /* UseMovieImageTests.swift */; };
EA448C9AEC5C0557A2D7E5AE /* UseMovieImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5810E9F25406110219E85558 /* UseMovieImage.swift */; };
FD3C5671D1D418C83F942AD1 /* Hooks in Frameworks */ = {isa = PBXBuildFile; productRef = 730FC334EE87751624C20337 /* Hooks */; };
Expand All @@ -41,9 +42,17 @@
remoteGlobalIDString = 1BE56B92EC9A6D5640796206;
remoteInfo = "TheMovieDB-MVVM";
};
6923F5616464B67B11D5420D /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 604281A06A1DE9F942BCBA73 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 25301600C3492D579FE1E91C;
remoteInfo = Todo;
};
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
03B06DA75E791F7A1E0B6542 /* SimpleUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SimpleUITests.swift; sourceTree = "<group>"; };
1117F627EF5B370FD8AEA502 /* Dependency.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dependency.swift; sourceTree = "<group>"; };
1AABBBF7596FB58F4051F423 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
20A38A9D88C5F0D2B9CCAC13 /* UseTopRatedMoviesViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UseTopRatedMoviesViewModelTests.swift; sourceTree = "<group>"; };
Expand All @@ -58,6 +67,7 @@
65ED06BAB6A47DBDBE4B7D43 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
6A4277642C7FCF9F14B33FDC /* SwiftUI-Hooks */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "SwiftUI-Hooks"; path = ..; sourceTree = SOURCE_ROOT; };
6CD5F67CEEAFE74811B93864 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
803EE7E5F67D8627C8A11060 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
86069121E82E72BAE07609D9 /* BasicUsage.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = BasicUsage.app; sourceTree = BUILT_PRODUCTS_DIR; };
895CD000DCB5854C20C39119 /* MovieDBServiceMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MovieDBServiceMock.swift; sourceTree = "<group>"; };
8AC5A16C0EDE1832418D3B44 /* PagedResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PagedResponse.swift; sourceTree = "<group>"; };
Expand All @@ -73,6 +83,7 @@
D069A011D27489BADCA6B8C6 /* IndexPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IndexPage.swift; sourceTree = "<group>"; };
D4D224DD8896BC0368816053 /* MovieDetailPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MovieDetailPage.swift; sourceTree = "<group>"; };
E1B5863034D96951456EB762 /* Movie.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Movie.swift; sourceTree = "<group>"; };
EC5E3D08FA8414516FB398A3 /* Todo-UITests.xctest */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.cfbundle; path = "Todo-UITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
F6B3D3D179C2DD7456748DBF /* UseTopRatedMoviesViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UseTopRatedMoviesViewModel.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -155,11 +166,21 @@
86069121E82E72BAE07609D9 /* BasicUsage.app */,
2D5F81DFBD08056D0FD7F5BD /* TheMovieDB-MVVM-Tests.xctest */,
959951B8FA9CB35BA897D008 /* TheMovieDB-MVVM.app */,
EC5E3D08FA8414516FB398A3 /* Todo-UITests.xctest */,
A80807CB4E7902470EE2CF4E /* Todo.app */,
);
name = Products;
sourceTree = "<group>";
};
602E58297B09F558F092C6E8 /* Todo-UITests */ = {
isa = PBXGroup;
children = (
803EE7E5F67D8627C8A11060 /* Info.plist */,
03B06DA75E791F7A1E0B6542 /* SimpleUITests.swift */,
);
path = "Todo-UITests";
sourceTree = "<group>";
};
75EDD3CCD230721B3E6BAB29 /* Entity */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -197,6 +218,7 @@
1C54E82AAAA2004F80EE1845 /* TheMovieDB-MVVM */,
8707F115112CEE1DF3CEAD8C /* TheMovieDB-MVVM-Tests */,
FF987BC196B244AB30F65F6F /* Todo */,
602E58297B09F558F092C6E8 /* Todo-UITests */,
3FDBCEEB7C4C53F0545FC427 /* Products */,
);
sourceTree = "<group>";
Expand Down Expand Up @@ -288,6 +310,22 @@
productReference = 86069121E82E72BAE07609D9 /* BasicUsage.app */;
productType = "com.apple.product-type.application";
};
EEC38F915B7D99D569F83626 /* Todo-UITests */ = {
isa = PBXNativeTarget;
buildConfigurationList = A0E520687A7E899443BD1D7A /* Build configuration list for PBXNativeTarget "Todo-UITests" */;
buildPhases = (
79FE86001C96F63157046F01 /* Sources */,
);
buildRules = (
);
dependencies = (
8FEC0AC4B0064E95C5B51684 /* PBXTargetDependency */,
);
name = "Todo-UITests";
productName = "Todo-UITests";
productReference = EC5E3D08FA8414516FB398A3 /* Todo-UITests.xctest */;
productType = "com.apple.product-type.bundle.ui-testing";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
Expand All @@ -305,6 +343,9 @@
C9D938E5D4F411CE3B24C601 = {
ProvisioningStyle = Manual;
};
EEC38F915B7D99D569F83626 = {
TestTargetID = 25301600C3492D579FE1E91C;
};
};
};
buildConfigurationList = 2A75F03E88AFDF6CA6BA2141 /* Build configuration list for PBXProject "Examples" */;
Expand All @@ -323,6 +364,7 @@
1BE56B92EC9A6D5640796206 /* TheMovieDB-MVVM */,
87A81926411A12A06729F58D /* TheMovieDB-MVVM-Tests */,
25301600C3492D579FE1E91C /* Todo */,
EEC38F915B7D99D569F83626 /* Todo-UITests */,
);
};
/* End PBXProject section */
Expand Down Expand Up @@ -360,6 +402,14 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
79FE86001C96F63157046F01 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
DCDC2A61345B88907286B20C /* SimpleUITests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
DDFC049A46991C77CA4AF828 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
Expand All @@ -385,9 +435,32 @@
target = 1BE56B92EC9A6D5640796206 /* TheMovieDB-MVVM */;
targetProxy = 4B357514BD0590074B5DD989 /* PBXContainerItemProxy */;
};
8FEC0AC4B0064E95C5B51684 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 25301600C3492D579FE1E91C /* Todo */;
targetProxy = 6923F5616464B67B11D5420D /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

/* Begin XCBuildConfiguration section */
0378D4E4F964E0C734F2E043 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
INFOPLIST_FILE = "Todo-UITests/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.ryo.swiftui-hooks-examples.Todo-UITests";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = Todo;
};
name = Debug;
};
069B3BEB5169911F43F16C72 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
Expand All @@ -412,6 +485,24 @@
};
name = Release;
};
0FABCDD37FE09E33DEF09AD6 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
INFOPLIST_FILE = "Todo-UITests/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.ryo.swiftui-hooks-examples.Todo-UITests";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = Todo;
};
name = Release;
};
411D97DEB7A3E977012CCD82 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
Expand Down Expand Up @@ -722,6 +813,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
};
A0E520687A7E899443BD1D7A /* Build configuration list for PBXNativeTarget "Todo-UITests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
0378D4E4F964E0C734F2E043 /* Debug */,
0FABCDD37FE09E33DEF09AD6 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
};
D8ADB1CD2EE5DC0E6AB82516 /* Build configuration list for PBXNativeTarget "TheMovieDB-MVVM-Tests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1200"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
runPostActionsOnFailure = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EEC38F915B7D99D569F83626"
BuildableName = "Todo-UITests.xctest"
BlueprintName = "Todo-UITests"
ReferencedContainer = "container:Examples.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
onlyGenerateCoverageForSpecifiedTargets = "NO"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EEC38F915B7D99D569F83626"
BuildableName = "Todo-UITests.xctest"
BlueprintName = "Todo-UITests"
ReferencedContainer = "container:Examples.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EEC38F915B7D99D569F83626"
BuildableName = "Todo-UITests.xctest"
BlueprintName = "Todo-UITests"
ReferencedContainer = "container:Examples.xcodeproj">
</BuildableReference>
</MacroExpansion>
<CommandLineArguments>
</CommandLineArguments>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EEC38F915B7D99D569F83626"
BuildableName = "Todo-UITests.xctest"
BlueprintName = "Todo-UITests"
ReferencedContainer = "container:Examples.xcodeproj">
</BuildableReference>
</MacroExpansion>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EEC38F915B7D99D569F83626"
BuildableName = "Todo-UITests.xctest"
BlueprintName = "Todo-UITests"
ReferencedContainer = "container:Examples.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Loading