Skip to content
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
77 changes: 47 additions & 30 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: iOS starter workflow
name: iOS CI

on:
push:
Expand All @@ -7,20 +7,27 @@ on:
branches: [ "dev" ]

jobs:

# Job의 label user 지정 값
build:
name: Build and Test default scheme using any available iPhone simulator
runs-on: macos-latest

# Xcode 빌드 환경 변수
env:
project: ${{ 'AIProject/iCo.xcodeproj' }}
scheme: ${{ 'iCoTests' }}
platform: ${{ 'iOS Simulator' }}
device: ${{ 'iPhone 16 Pro' }}
os: ${{ '18.6' }}

# Script나 action 등의 실행
steps:

# 레파지토리 체크인
- name: Checkout
uses: actions/checkout@v4

# XCConfig / GoogleService 등의 파일을 클론
- name: Clone Secret file
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ESTiOSAI/Secrets
path: temp/
Expand All @@ -31,32 +38,42 @@ jobs:
run: |
mv temp/XCConfig/Secrets.xcconfig AIProject/iCo/App/Resource/
mv temp/GoogleServices/GoogleService-Info.plist AIProject/iCo/App/Resource/

- name: Set Default Scheme
# SPM Dependency 캐싱
- name: Cache Swift Packages
uses: actions/cache@v4
with:
path: |
~/Library/Developer/Xcode/DerivedData/*/SourcePackages
# .build
# ~/.swiftpm
# ~/Library/Caches/org.swift.swiftpm
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
# SPM Resolve
- name: Resolve Packages
run: |
scheme_list=$(xcodebuild -list -json | tr -d "\n")
default=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['project']['targets'][0]")
echo $default | cat >default
echo Using default scheme: $default
cd AIProject
xcodebuild -resolvePackageDependencies -scheme "$scheme"
# 모듈 캐싱
# - name: Cache DerivedData
# uses: actions/cache@v4
# with:
# path: ~/Library/Developer/Xcode/DerivedData
# key: ${{ runner.os }}-build-${{ hashFiles('**/*.swift') }}
# restore-keys: |
# ${{ runner.os }}-build-

- name: Build
env:
scheme: ${{ 'default' }}
platform: ${{ 'iOS Simulator' }}
run: |
# xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959)
device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//"`
if [ $scheme = default ]; then scheme=$(cat default); fi
if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi
file_to_build=`echo $file_to_build | awk '{$1=$1;print}'`
xcodebuild build-for-testing -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,name=$device"
xcodebuild build-for-testing \
-project "$project" \
-scheme "$scheme" \
-destination "platform=$platform,name=$device,OS=18.6"

- name: Test
env:
scheme: ${{ 'default' }}
platform: ${{ 'iOS Simulator' }}
run: |
# xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959)
device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//"`
if [ $scheme = default ]; then scheme=$(cat default); fi
if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi
file_to_build=`echo $file_to_build | awk '{$1=$1;print}'`
xcodebuild test-without-building -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,name=$device"
xcodebuild test-without-building \
-project "$project" \
-scheme "$scheme" \
-destination "platform=$platform,name=$device,OS=18.6"
40 changes: 22 additions & 18 deletions AIProject/iCo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
objects = {

/* Begin PBXBuildFile section */
A9C265DA2E40B11D00C987E5 /* Secrets.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = A9C265D92E40B11D00C987E5 /* Secrets.xcconfig */; };
A9C265DB2E40B12500C987E5 /* Secrets.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = A9C265D92E40B11D00C987E5 /* Secrets.xcconfig */; };
A9F6C9F22E4465FE005D88E2 /* AsyncAlgorithms in Frameworks */ = {isa = PBXBuildFile; productRef = A9F6C9F12E4465FE005D88E2 /* AsyncAlgorithms */; };
B75CFBAD2E45D42C0055632C /* AdServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B75CFBAC2E45D42C0055632C /* AdServices.framework */; };
B75D1B1E2E4597FC006839B5 /* FirebaseAnalytics in Frameworks */ = {isa = PBXBuildFile; productRef = B75D1B1D2E4597FC006839B5 /* FirebaseAnalytics */; };
Expand Down Expand Up @@ -52,7 +50,6 @@

/* Begin PBXFileReference section */
4E50EAE62E64B18E005AE3BB /* iCo.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = iCo.xctestplan; sourceTree = "<group>"; };
A9C265D92E40B11D00C987E5 /* Secrets.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Secrets.xcconfig; sourceTree = "<group>"; };
B75CFBAC2E45D42C0055632C /* AdServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdServices.framework; path = System/Library/Frameworks/AdServices.framework; sourceTree = SDKROOT; };
B75D1B212E459ADB006839B5 /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; };
B7B040032E387FCF005DE0BA /* iCo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iCo.app; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -180,7 +177,6 @@
children = (
B7C71D412E7BDB70000E1191 /* iCOWidgetExtension.entitlements */,
4E50EAE62E64B18E005AE3BB /* iCo.xctestplan */,
A9C265D92E40B11D00C987E5 /* Secrets.xcconfig */,
B7B040052E387FCF005DE0BA /* iCo */,
B7B040182E387FD1005DE0BA /* iCoTests */,
B7C71D2E2E7BD9D7000E1191 /* iCOWidget */,
Expand Down Expand Up @@ -327,15 +323,13 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A9C265DA2E40B11D00C987E5 /* Secrets.xcconfig in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
B7B040132E387FD1005DE0BA /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A9C265DB2E40B12500C987E5 /* Secrets.xcconfig in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -414,7 +408,8 @@
/* Begin XCBuildConfiguration section */
B7B040272E387FD1005DE0BA /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = A9C265D92E40B11D00C987E5 /* Secrets.xcconfig */;
baseConfigurationReferenceAnchor = B7B040052E387FCF005DE0BA /* iCo */;
baseConfigurationReferenceRelativePath = App/Resource/Secrets.xcconfig;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
Expand Down Expand Up @@ -480,7 +475,8 @@
};
B7B040282E387FD1005DE0BA /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = A9C265D92E40B11D00C987E5 /* Secrets.xcconfig */;
baseConfigurationReferenceAnchor = B7B040052E387FCF005DE0BA /* iCo */;
baseConfigurationReferenceRelativePath = App/Resource/Secrets.xcconfig;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
Expand Down Expand Up @@ -539,7 +535,8 @@
};
B7B0402A2E387FD1005DE0BA /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = A9C265D92E40B11D00C987E5 /* Secrets.xcconfig */;
baseConfigurationReferenceAnchor = B7B040052E387FCF005DE0BA /* iCo */;
baseConfigurationReferenceRelativePath = App/Resource/Secrets.xcconfig;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
Expand Down Expand Up @@ -571,7 +568,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.est.ico;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = icoprovisioning;
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match Development com.est.ico";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -580,7 +577,8 @@
};
B7B0402B2E387FD1005DE0BA /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = A9C265D92E40B11D00C987E5 /* Secrets.xcconfig */;
baseConfigurationReferenceAnchor = B7B040052E387FCF005DE0BA /* iCo */;
baseConfigurationReferenceRelativePath = App/Resource/Secrets.xcconfig;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
Expand Down Expand Up @@ -611,7 +609,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.est.ico;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = icoprovisioning;
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match Development com.est.ico";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -620,17 +618,20 @@
};
B7B0402D2E387FD1005DE0BA /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = A9C265D92E40B11D00C987E5 /* Secrets.xcconfig */;
baseConfigurationReferenceAnchor = B7B040052E387FCF005DE0BA /* iCo */;
baseConfigurationReferenceRelativePath = App/Resource/Secrets.xcconfig;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = SJDR485DTV;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.est.ai.iCoTests;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
Expand All @@ -644,17 +645,20 @@
};
B7B0402E2E387FD1005DE0BA /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = A9C265D92E40B11D00C987E5 /* Secrets.xcconfig */;
baseConfigurationReferenceAnchor = B7B040052E387FCF005DE0BA /* iCo */;
baseConfigurationReferenceRelativePath = App/Resource/Secrets.xcconfig;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = SJDR485DTV;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.est.ai.iCoTests;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
Expand Down Expand Up @@ -692,7 +696,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.est.ico.widget;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = icoprovisioningwidget;
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match Development com.est.ico.widget";
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
Expand Down Expand Up @@ -726,7 +730,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.est.ico.widget;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = icoprovisioningwidget;
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match Development com.est.ico.widget";
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
Expand Down
Loading