From 29db2368ccdaeef0cfb4dddd7a02e87de8bd5172 Mon Sep 17 00:00:00 2001 From: Jaesung Lee Date: Fri, 6 Oct 2023 19:12:05 +0900 Subject: [PATCH 1/4] =?UTF-8?q?[=EC=B6=94=EA=B0=80]=20KuringApp=20?= =?UTF-8?q?=EC=8A=A4=ED=82=B4=20=EB=B9=8C=EB=93=9C=20=EC=8A=A4=ED=81=AC?= =?UTF-8?q?=EB=A6=BD=ED=8A=B8=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20=EB=B9=8C?= =?UTF-8?q?=EB=93=9C=20=EB=B2=84=EC=A0=84=20iOS16=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - [수정] 앱 번들아이디, 버전 설정 및 PR 자동머지 스크립트 추가 - [추가] 스위프트 패키지 빌드 스크립트 추가 --- .github/workflows/BUILD_APP_TARGET_iOS16.yml | 77 +++++++++++++++++++ .github/workflows/BUILD_APP_TARGET_iOS17.yml | 71 +++++++++++++++++ .github/workflows/BUILD_PACKAGE.yml | 71 +++++++++++++++++ .github/workflows/MERGE_PR.yml | 62 +++++++++++++++ KuringApp/KuringApp.xcodeproj/project.pbxproj | 20 +++-- README.md | 17 ++++ 6 files changed, 310 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/BUILD_APP_TARGET_iOS16.yml create mode 100644 .github/workflows/BUILD_APP_TARGET_iOS17.yml create mode 100644 .github/workflows/BUILD_PACKAGE.yml create mode 100644 .github/workflows/MERGE_PR.yml diff --git a/.github/workflows/BUILD_APP_TARGET_iOS16.yml b/.github/workflows/BUILD_APP_TARGET_iOS16.yml new file mode 100644 index 00000000..04980630 --- /dev/null +++ b/.github/workflows/BUILD_APP_TARGET_iOS16.yml @@ -0,0 +1,77 @@ +name: 쿠링 앱타겟 최소 버전에서 빌드하기 + +on: + push: + branches: [ main ] + issue_comment: + types: [created, edited] + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + if: github.event.issue.pull_request && contains(github.event.comment.body, '/쿠링') && contains(github.event.comment.body, 'ios16 앱 빌드') + runs-on: macos-13 #최신버전 + steps: + # 빌드 요청 시작 + - name: Build iOS16 + run: | + echo "iOS16 에서 앱 타겟을 빌드합니다." + + # build package 빌드 응답 커멘트 + - name: Add Build comment + uses: actions/github-script@v5 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '🔨 iOS 16.2 iPhone 14 Pro 에서 쿠링 앱을 빌드합니다.' + }) + + # 코드를 체크아웃 합니다. + - name: Checkout repository + uses: actions/checkout@v2 + + # Xcode 버전을 설정합니다. + - name: Setup Xcode version + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '14.3' + + # KuringApp 스킴을 빌드합니다. + - name: KuringApp 빌드 + run: | + cd KuringApp + xcodebuild build -scheme KuringApp -destination 'platform=iOS Simulator,OS=16.2,name=iPhone 14 Pro' + + # 빌드 성공시 커멘트 + - name: Add Build comment + uses: actions/github-script@v5 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '✅ iOS16 에서 앱 타겟을 성공적으로 빌드했습니다.' + }) + + # 빌드 실패시 커멘트 + - name: Notify failure + uses: actions/github-script@v5 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '📬 iOS16 에서 앱 타겟 빌드에 실패했습니다. Actions에서 실패 결과를 확인해주세요.' + }) + if: failure() diff --git a/.github/workflows/BUILD_APP_TARGET_iOS17.yml b/.github/workflows/BUILD_APP_TARGET_iOS17.yml new file mode 100644 index 00000000..55506fe8 --- /dev/null +++ b/.github/workflows/BUILD_APP_TARGET_iOS17.yml @@ -0,0 +1,71 @@ +name: 쿠링 앱타겟 iOS17에서 빌드하기 + +on: + issue_comment: + types: [created, edited] + +jobs: + build: + if: github.event.issue.pull_request && contains(github.event.comment.body, '/쿠링') && contains(github.event.comment.body, 'ios17 앱 빌드') + runs-on: macos-13 #최신버전 + steps: + # 빌드 요청 시작 + - name: Build iOS17 + run: | + echo "iOS17 에서 앱 타겟을 빌드합니다." + + # iOS17 빌드 응답 커멘트 + - name: Add Build comment + uses: actions/github-script@v5 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '🔨 iOS 17.0 iPhone 14 Pro 에서 쿠링 앱을 빌드합니다.' + }) + + # 코드를 체크아웃 합니다. + - name: Checkout repository + uses: actions/checkout@v2 + + # Xcode 버전을 설정합니다. + - name: Setup Xcode version + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '15.0' + + # KuringApp 스킴을 빌드합니다. + - name: KuringApp 빌드 + run: | + cd KuringApp + xcodebuild build -scheme KuringApp -destination 'platform=iOS Simulator,OS=17.0,name=iPhone 14 Pro' + + # 빌드 성공시 커멘트 + - name: Add Build comment + uses: actions/github-script@v5 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '✅ iOS17 에서 앱 타겟을 성공적으로 빌드했습니다.' + }) + + # 빌드 실패시 커멘트 + - name: Notify failure + uses: actions/github-script@v5 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '📬 iOS17 에서 앱 타겟 빌드에 실패했습니다. Actions에서 실패 결과를 확인해주세요.' + }) + if: failure() diff --git a/.github/workflows/BUILD_PACKAGE.yml b/.github/workflows/BUILD_PACKAGE.yml new file mode 100644 index 00000000..f899e62a --- /dev/null +++ b/.github/workflows/BUILD_PACKAGE.yml @@ -0,0 +1,71 @@ +name: 쿠링 스위프트 패키지 빌드하기 + +on: + issue_comment: + types: [created, edited] + +jobs: + build: + if: github.event.issue.pull_request && contains(github.event.comment.body, '/쿠링') && contains(github.event.comment.body, '패키지 빌드') + runs-on: macos-13 #최신버전 + steps: + # 빌드 요청 시작 + - name: Build iOS17 + run: | + echo "start build" + + # build package 빌드 응답 커멘트 + - name: Add Build comment + uses: actions/github-script@v5 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '🔨 iOS 16.2 iPhone 14 Pro 에서 스위프트 패키지를 빌드합니다.' + }) + + # 코드를 체크아웃 합니다. + - name: Checkout repository + uses: actions/checkout@v2 + + # Xcode 버전을 설정합니다. + - name: Setup Xcode version + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '15.0' + + # KuringModulePackage 패키지를 빌드합니다. (최소 버전) + - name: KuringModulePackage 빌드 + run: | + cd KuringModulePackage + xcodebuild build -scheme KuringModulePackage -destination 'platform=iOS Simulator,OS=latest,name=iPhone 14 Pro' + + # 빌드 성공시 커멘트 + - name: Add Build comment + uses: actions/github-script@v5 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '✅ 패키지를 성공적으로 빌드했습니다.' + }) + + # 빌드 실패시 커멘트 + - name: Notify failure + uses: actions/github-script@v5 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '📬 패키지 빌드에 실패했습니다. Actions에서 실패 결과를 확인해주세요.' + }) + if: failure() diff --git a/.github/workflows/MERGE_PR.yml b/.github/workflows/MERGE_PR.yml new file mode 100644 index 00000000..19a48858 --- /dev/null +++ b/.github/workflows/MERGE_PR.yml @@ -0,0 +1,62 @@ +name: PR을 자동 머지 합니다 + +on: + issue_comment: + types: [created, edited] + +jobs: + automerge-pr: + if: github.event.issue.pull_request && contains(github.event.comment.body, '/쿠링') && contains(github.event.comment.body, '머지') + runs-on: ubuntu-latest #최신버전 + steps: + ## 체크아웃 + - name: checkout + uses: actions/checkout@v2 + + ## automerge 라벨 추가 + - name: add label + uses: actions-ecosystem/action-add-labels@v1 + with: + labels: automerge + + # 머지 시도 시작 + - name: Build iOS17 + run: | + echo "PR 머지를 시도합니다" + + # 자동 머지 + - id: automerge # 라벨과 관련이 있나...? + name: automerge + uses: "pascalgn/automerge-action@v0.15.6" + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + MERGE_METHOD: "squash" # 스쿼시하고 머지 + MERGE_REQUIRED_APPROVALS: "1" # 최소 승인 개수 + + # 머지 완료 알리기 + - name: Notify Merge + if: steps.automerge.outputs.mergeResult == 'merged' + uses: actions/github-script@v5 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '🕊️ PR #${{ steps.automerge.outputs.pullRequestNumber }}이 머지되었습니다.' + }) + + # 머지 실패 알리기 + - name: Notify failure + if: steps.automerge.outputs.mergeResult != 'merged' + uses: actions/github-script@v5 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '🗿 머지 시도 실패. 승인 개수, 테스트 성공 여부 등 자동 머지 조건을 만족하는지 확인하세요.' + }) diff --git a/KuringApp/KuringApp.xcodeproj/project.pbxproj b/KuringApp/KuringApp.xcodeproj/project.pbxproj index 4b6b6ed0..471d7793 100644 --- a/KuringApp/KuringApp.xcodeproj/project.pbxproj +++ b/KuringApp/KuringApp.xcodeproj/project.pbxproj @@ -421,17 +421,19 @@ ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = KuringApp/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = "쿠링"; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; + IPHONEOS_DEPLOYMENT_TARGET = 16; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.jsung.KuringApp; + MARKETING_VERSION = 2.0.0; + PRODUCT_BUNDLE_IDENTIFIER = com.kuring.service; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; @@ -451,17 +453,19 @@ ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = KuringApp/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = "쿠링"; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; + IPHONEOS_DEPLOYMENT_TARGET = 16; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.jsung.KuringApp; + MARKETING_VERSION = 2.0.0; + PRODUCT_BUNDLE_IDENTIFIER = com.kuring.service; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; diff --git a/README.md b/README.md index e316ac9e..96064587 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,23 @@ https://www.notion.so/kuring/v2-55977b79a8014c2883ad4c89085e1464?pvs=4 +## GitHub Actions + +반드시 `/쿠링` 으로 시작할 것. + +### 빌드 +- `ios16 앱 빌드` +- `ios17 앱 빌드` +- `패키지 빌드` + +### PR 머지 +- `머지` + +### 추가 사용법 +``` +/쿠링 ios17 앱 빌드하고 패키지 빌드하고 머지해줘 +``` + ## Code owners - [jaesung-0o0](https://github.com/jaesung-0o0) From e24781149d3b7ae882520fefe24d86f91e08f87e Mon Sep 17 00:00:00 2001 From: Jaesung Lee Date: Tue, 10 Oct 2023 23:10:36 +0900 Subject: [PATCH 2/4] no message --- .github/workflows/BUILD_APP_TARGET_iOS16.yml | 6 +- KuringApp/KuringApp.xcodeproj/project.pbxproj | 129 ++++++++++++++++++ .../xcshareddata/xcschemes/KuringApp.xcscheme | 13 ++ .../xcschemes/KuringAppTests.xcscheme | 54 ++++++++ KuringApp/KuringApp/NoticeApp.Path.swift | 2 +- KuringApp/KuringApp/NoticeApp.swift | 2 +- KuringApp/KuringAppTests/NoticeAppTests.swift | 35 +++++ 7 files changed, 236 insertions(+), 5 deletions(-) create mode 100644 KuringApp/KuringApp.xcodeproj/xcshareddata/xcschemes/KuringAppTests.xcscheme create mode 100644 KuringApp/KuringAppTests/NoticeAppTests.swift diff --git a/.github/workflows/BUILD_APP_TARGET_iOS16.yml b/.github/workflows/BUILD_APP_TARGET_iOS16.yml index 04980630..798906a3 100644 --- a/.github/workflows/BUILD_APP_TARGET_iOS16.yml +++ b/.github/workflows/BUILD_APP_TARGET_iOS16.yml @@ -30,7 +30,7 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: '🔨 iOS 16.2 iPhone 14 Pro 에서 쿠링 앱을 빌드합니다.' + body: '🔨 iOS 16 iPhone 14 Pro 에서 쿠링 앱을 빌드합니다.' }) # 코드를 체크아웃 합니다. @@ -41,13 +41,13 @@ jobs: - name: Setup Xcode version uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: '14.3' + xcode-version: '15.0' # KuringApp 스킴을 빌드합니다. - name: KuringApp 빌드 run: | cd KuringApp - xcodebuild build -scheme KuringApp -destination 'platform=iOS Simulator,OS=16.2,name=iPhone 14 Pro' + xcodebuild clean test -project KuringApp.xcodeproj -scheme KuringApp -destination 'platform=iOS Simulator,OS=16.2,name=iPhone 14 Pro' # 빌드 성공시 커멘트 - name: Add Build comment diff --git a/KuringApp/KuringApp.xcodeproj/project.pbxproj b/KuringApp/KuringApp.xcodeproj/project.pbxproj index 471d7793..9f802118 100644 --- a/KuringApp/KuringApp.xcodeproj/project.pbxproj +++ b/KuringApp/KuringApp.xcodeproj/project.pbxproj @@ -24,6 +24,7 @@ A9DAFA562AB1F04B0064F748 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9DAFA552AB1F04B0064F748 /* ContentView.swift */; }; A9DAFA582AB1F04C0064F748 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A9DAFA572AB1F04C0064F748 /* Assets.xcassets */; }; A9DAFA5B2AB1F04C0064F748 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A9DAFA5A2AB1F04C0064F748 /* Preview Assets.xcassets */; }; + CA52DF392AD58F4B009B9272 /* NoticeAppTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA52DF382AD58F4B009B9272 /* NoticeAppTests.swift */; }; DF331DAB2AC917E100D0BB08 /* kuring_app.png in Resources */ = {isa = PBXBuildFile; fileRef = DF331DA72AC917E000D0BB08 /* kuring_app.png */; }; DF331DAC2AC917E100D0BB08 /* kuring_app_classic.png in Resources */ = {isa = PBXBuildFile; fileRef = DF331DA82AC917E000D0BB08 /* kuring_app_classic.png */; }; DF331DAD2AC917E100D0BB08 /* kuring_app_sketch.png in Resources */ = {isa = PBXBuildFile; fileRef = DF331DA92AC917E000D0BB08 /* kuring_app_sketch.png */; }; @@ -32,6 +33,16 @@ DFE7AB172AC33D6700230934 /* AppIconSelector.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFE7AB162AC33D6700230934 /* AppIconSelector.swift */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + CA52DF332AD58DF2009B9272 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A9DAFA482AB1F04B0064F748 /* Project object */; + proxyType = 1; + remoteGlobalIDString = A9DAFA4F2AB1F04B0064F748; + remoteInfo = KuringApp; + }; +/* End PBXContainerItemProxy section */ + /* Begin PBXFileReference section */ A965B7A22AC013060026ECDC /* DepartmentEditor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DepartmentEditor.swift; sourceTree = ""; }; A965B7A42AC013BF0026ECDC /* DepartmentSelector.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DepartmentSelector.swift; sourceTree = ""; }; @@ -49,6 +60,8 @@ A9DAFA572AB1F04C0064F748 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; A9DAFA5A2AB1F04C0064F748 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; A9DAFA662AB1F09B0064F748 /* KuringModulePackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = KuringModulePackage; path = ../KuringModulePackage; sourceTree = ""; }; + CA52DF2F2AD58DF2009B9272 /* KuringAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = KuringAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + CA52DF382AD58F4B009B9272 /* NoticeAppTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NoticeAppTests.swift; sourceTree = ""; }; DF062D4A2AC87B6D00FC48C0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; DF331DA72AC917E000D0BB08 /* kuring_app.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = kuring_app.png; sourceTree = ""; }; DF331DA82AC917E000D0BB08 /* kuring_app_classic.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = kuring_app_classic.png; sourceTree = ""; }; @@ -69,6 +82,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + CA52DF2C2AD58DF2009B9272 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -127,6 +147,7 @@ children = ( A9DAFA662AB1F09B0064F748 /* KuringModulePackage */, A9DAFA522AB1F04B0064F748 /* KuringApp */, + CA52DF302AD58DF2009B9272 /* KuringAppTests */, A9DAFA512AB1F04B0064F748 /* Products */, A947DCBA2AB47BA300A6D614 /* Frameworks */, ); @@ -136,6 +157,7 @@ isa = PBXGroup; children = ( A9DAFA502AB1F04B0064F748 /* KuringApp.app */, + CA52DF2F2AD58DF2009B9272 /* KuringAppTests.xctest */, ); name = Products; sourceTree = ""; @@ -168,6 +190,14 @@ path = "Preview Content"; sourceTree = ""; }; + CA52DF302AD58DF2009B9272 /* KuringAppTests */ = { + isa = PBXGroup; + children = ( + CA52DF382AD58F4B009B9272 /* NoticeAppTests.swift */, + ); + path = KuringAppTests; + sourceTree = ""; + }; DF062D4B2AC8800000FC48C0 /* AppLogos */ = { isa = PBXGroup; children = ( @@ -214,6 +244,24 @@ productReference = A9DAFA502AB1F04B0064F748 /* KuringApp.app */; productType = "com.apple.product-type.application"; }; + CA52DF2E2AD58DF2009B9272 /* KuringAppTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = CA52DF372AD58DF2009B9272 /* Build configuration list for PBXNativeTarget "KuringAppTests" */; + buildPhases = ( + CA52DF2B2AD58DF2009B9272 /* Sources */, + CA52DF2C2AD58DF2009B9272 /* Frameworks */, + CA52DF2D2AD58DF2009B9272 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + CA52DF342AD58DF2009B9272 /* PBXTargetDependency */, + ); + name = KuringAppTests; + productName = KuringAppTests; + productReference = CA52DF2F2AD58DF2009B9272 /* KuringAppTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -227,6 +275,10 @@ A9DAFA4F2AB1F04B0064F748 = { CreatedOnToolsVersion = 15.0; }; + CA52DF2E2AD58DF2009B9272 = { + CreatedOnToolsVersion = 15.0; + TestTargetID = A9DAFA4F2AB1F04B0064F748; + }; }; }; buildConfigurationList = A9DAFA4B2AB1F04B0064F748 /* Build configuration list for PBXProject "KuringApp" */; @@ -245,6 +297,7 @@ projectRoot = ""; targets = ( A9DAFA4F2AB1F04B0064F748 /* KuringApp */, + CA52DF2E2AD58DF2009B9272 /* KuringAppTests */, ); }; /* End PBXProject section */ @@ -263,6 +316,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + CA52DF2D2AD58DF2009B9272 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -287,8 +347,24 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + CA52DF2B2AD58DF2009B9272 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CA52DF392AD58F4B009B9272 /* NoticeAppTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + CA52DF342AD58DF2009B9272 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = A9DAFA4F2AB1F04B0064F748 /* KuringApp */; + targetProxy = CA52DF332AD58DF2009B9272 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin XCBuildConfiguration section */ A9DAFA5C2AB1F04C0064F748 /* Debug */ = { isa = XCBuildConfiguration; @@ -473,6 +549,50 @@ }; name = Release; }; + CA52DF352AD58DF2009B9272 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 77CD4KLN3Y; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; + MACOSX_DEPLOYMENT_TARGET = 14.0; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.kuring.service.KuringAppTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/KuringApp.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/KuringApp"; + }; + name = Debug; + }; + CA52DF362AD58DF2009B9272 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 77CD4KLN3Y; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; + MACOSX_DEPLOYMENT_TARGET = 14.0; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.kuring.service.KuringAppTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/KuringApp.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/KuringApp"; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -494,6 +614,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + CA52DF372AD58DF2009B9272 /* Build configuration list for PBXNativeTarget "KuringAppTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CA52DF352AD58DF2009B9272 /* Debug */, + CA52DF362AD58DF2009B9272 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ /* Begin XCSwiftPackageProductDependency section */ diff --git a/KuringApp/KuringApp.xcodeproj/xcshareddata/xcschemes/KuringApp.xcscheme b/KuringApp/KuringApp.xcodeproj/xcshareddata/xcschemes/KuringApp.xcscheme index 4a060666..84b047d9 100644 --- a/KuringApp/KuringApp.xcodeproj/xcshareddata/xcschemes/KuringApp.xcscheme +++ b/KuringApp/KuringApp.xcodeproj/xcshareddata/xcschemes/KuringApp.xcscheme @@ -28,6 +28,19 @@ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES" shouldAutocreateTestPlan = "YES"> + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/KuringApp/KuringApp/NoticeApp.Path.swift b/KuringApp/KuringApp/NoticeApp.Path.swift index 2e511a22..d41e1151 100644 --- a/KuringApp/KuringApp/NoticeApp.Path.swift +++ b/KuringApp/KuringApp/NoticeApp.Path.swift @@ -11,7 +11,7 @@ import ComposableArchitecture extension NoticeAppFeature { struct Path: Reducer { - enum State { + enum State: Equatable { case detail(NoticeDetailFeature.State) case search(SearchFeature.State) case departmentEditor(DepartmentEditorFeature.State) diff --git a/KuringApp/KuringApp/NoticeApp.swift b/KuringApp/KuringApp/NoticeApp.swift index 0895a5c8..77a1dbd6 100644 --- a/KuringApp/KuringApp/NoticeApp.swift +++ b/KuringApp/KuringApp/NoticeApp.swift @@ -10,7 +10,7 @@ import SwiftUI import ComposableArchitecture struct NoticeAppFeature: Reducer { - struct State { + struct State: Equatable { var path = StackState() var noticeList = NoticeListFeature.State() } diff --git a/KuringApp/KuringAppTests/NoticeAppTests.swift b/KuringApp/KuringAppTests/NoticeAppTests.swift new file mode 100644 index 00000000..66148529 --- /dev/null +++ b/KuringApp/KuringAppTests/NoticeAppTests.swift @@ -0,0 +1,35 @@ +// +// NoticeAppTests.swift +// KuringAppTests +// +// Created by 이재성 on 10/10/23. +// + +import XCTest +import ComposableArchitecture +@testable import KuringApp + +@MainActor +final class NoticeAppTests: XCTestCase { + /// 푸시 액션 테스트: 검색 버튼 눌렀을 때 + func test_editDepartment() async { + let store = TestStore( + initialState: NoticeAppFeature.State( + noticeList: NoticeListFeature.State() + ), + reducer: { NoticeAppFeature() } + ) + + // 푸시 액션: 검색 버튼 눌렀을 때 + await store.send( + .path( + .push( + id: 0, + state: .search(SearchFeature.State()) + ) + ) + ) { + $0.path[id: 0] = .search(SearchFeature.State()) + } + } +} From d17b5fafe7ad5a1e686207be136be2064c6c67ab Mon Sep 17 00:00:00 2001 From: Jaesung Lee Date: Tue, 10 Oct 2023 23:27:30 +0900 Subject: [PATCH 3/4] =?UTF-8?q?[=EC=88=98=EC=A0=95]=20Xcode15=20=EB=AF=B8?= =?UTF-8?q?=ED=95=B4=EA=B2=B0=20=EC=9D=B4=EC=8A=88=EC=97=90=20=EB=94=B0?= =?UTF-8?q?=EB=A5=B8=20ios16=20=EC=A3=BC=EC=84=9D=EC=B2=98=EB=A6=AC:=20Tes?= =?UTF-8?q?ts=20must=20be=20run=20on=20a=20concrete=20device?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/BUILD_APP_TARGET_iOS16.yml | 155 ++++++++++--------- 1 file changed, 78 insertions(+), 77 deletions(-) diff --git a/.github/workflows/BUILD_APP_TARGET_iOS16.yml b/.github/workflows/BUILD_APP_TARGET_iOS16.yml index 798906a3..9186c56a 100644 --- a/.github/workflows/BUILD_APP_TARGET_iOS16.yml +++ b/.github/workflows/BUILD_APP_TARGET_iOS16.yml @@ -1,77 +1,78 @@ -name: 쿠링 앱타겟 최소 버전에서 빌드하기 - -on: - push: - branches: [ main ] - issue_comment: - types: [created, edited] - -concurrency: - group: ci-${{ github.ref }} - cancel-in-progress: true - -jobs: - build: - if: github.event.issue.pull_request && contains(github.event.comment.body, '/쿠링') && contains(github.event.comment.body, 'ios16 앱 빌드') - runs-on: macos-13 #최신버전 - steps: - # 빌드 요청 시작 - - name: Build iOS16 - run: | - echo "iOS16 에서 앱 타겟을 빌드합니다." - - # build package 빌드 응답 커멘트 - - name: Add Build comment - uses: actions/github-script@v5 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: '🔨 iOS 16 iPhone 14 Pro 에서 쿠링 앱을 빌드합니다.' - }) - - # 코드를 체크아웃 합니다. - - name: Checkout repository - uses: actions/checkout@v2 - - # Xcode 버전을 설정합니다. - - name: Setup Xcode version - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: '15.0' - - # KuringApp 스킴을 빌드합니다. - - name: KuringApp 빌드 - run: | - cd KuringApp - xcodebuild clean test -project KuringApp.xcodeproj -scheme KuringApp -destination 'platform=iOS Simulator,OS=16.2,name=iPhone 14 Pro' - - # 빌드 성공시 커멘트 - - name: Add Build comment - uses: actions/github-script@v5 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: '✅ iOS16 에서 앱 타겟을 성공적으로 빌드했습니다.' - }) - - # 빌드 실패시 커멘트 - - name: Notify failure - uses: actions/github-script@v5 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: '📬 iOS16 에서 앱 타겟 빌드에 실패했습니다. Actions에서 실패 결과를 확인해주세요.' - }) - if: failure() +#name: 쿠링 앱타겟 최소 버전에서 빌드하기 +# +#on: +# push: +# branches: [ main ] +# issue_comment: +# types: [created, edited] +# +#concurrency: +# group: ci-${{ github.ref }} +# cancel-in-progress: true +# +#jobs: +# build: +# if: github.event.issue.pull_request && contains(github.event.comment.body, '/쿠링') && contains(github.event.comment.body, 'ios16 앱 빌드') +# runs-on: macos-13 #최신버전 +# steps: +# # 빌드 요청 시작 +# - name: Build iOS16 +# run: | +# echo "iOS16 에서 앱 타겟을 빌드합니다." +# +# # build package 빌드 응답 커멘트 +# - name: Add Build comment +# uses: actions/github-script@v5 +# with: +# github-token: ${{secrets.GITHUB_TOKEN}} +# script: | +# github.rest.issues.createComment({ +# issue_number: context.issue.number, +# owner: context.repo.owner, +# repo: context.repo.repo, +# body: '🔨 iOS 16 iPhone 14 Pro 에서 쿠링 앱을 빌드합니다.' +# }) +# +# # 코드를 체크아웃 합니다. +# - name: Checkout repository +# uses: actions/checkout@v2 +# +# # Xcode 버전을 설정합니다. +# - name: Setup Xcode version +# uses: maxim-lobanov/setup-xcode@v1 +# with: +# xcode-version: '15.0' +# +# # KuringApp 스킴을 빌드합니다. +# - name: KuringApp 빌드 +# run: | +# cd KuringApp +# xcrun xctrace list devices +# xcodebuild clean test -project KuringApp.xcodeproj -scheme KuringApp -destination 'platform=iOS Simulator,OS=16.2,name=iPhone 14 Pro' +# +# # 빌드 성공시 커멘트 +# - name: Add Build comment +# uses: actions/github-script@v5 +# with: +# github-token: ${{secrets.GITHUB_TOKEN}} +# script: | +# github.rest.issues.createComment({ +# issue_number: context.issue.number, +# owner: context.repo.owner, +# repo: context.repo.repo, +# body: '✅ iOS16 에서 앱 타겟을 성공적으로 빌드했습니다.' +# }) +# +# # 빌드 실패시 커멘트 +# - name: Notify failure +# uses: actions/github-script@v5 +# with: +# github-token: ${{secrets.GITHUB_TOKEN}} +# script: | +# github.rest.issues.createComment({ +# issue_number: context.issue.number, +# owner: context.repo.owner, +# repo: context.repo.repo, +# body: '📬 iOS16 에서 앱 타겟 빌드에 실패했습니다. Actions에서 실패 결과를 확인해주세요.' +# }) +# if: failure() From 166ca8d0c32b005bd3f096fb5e94f43af60d9044 Mon Sep 17 00:00:00 2001 From: Jaesung Lee Date: Wed, 11 Oct 2023 00:33:03 +0900 Subject: [PATCH 4/4] =?UTF-8?q?[=EC=88=98=EC=A0=95]=20ios16=20=EB=B9=8C?= =?UTF-8?q?=EB=93=9C=20=EC=8A=A4=ED=81=AC=EB=A6=BD=ED=8A=B8=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/BUILD_APP_TARGET_iOS16.yml | 78 -------------------- README.md | 1 - 2 files changed, 79 deletions(-) delete mode 100644 .github/workflows/BUILD_APP_TARGET_iOS16.yml diff --git a/.github/workflows/BUILD_APP_TARGET_iOS16.yml b/.github/workflows/BUILD_APP_TARGET_iOS16.yml deleted file mode 100644 index 9186c56a..00000000 --- a/.github/workflows/BUILD_APP_TARGET_iOS16.yml +++ /dev/null @@ -1,78 +0,0 @@ -#name: 쿠링 앱타겟 최소 버전에서 빌드하기 -# -#on: -# push: -# branches: [ main ] -# issue_comment: -# types: [created, edited] -# -#concurrency: -# group: ci-${{ github.ref }} -# cancel-in-progress: true -# -#jobs: -# build: -# if: github.event.issue.pull_request && contains(github.event.comment.body, '/쿠링') && contains(github.event.comment.body, 'ios16 앱 빌드') -# runs-on: macos-13 #최신버전 -# steps: -# # 빌드 요청 시작 -# - name: Build iOS16 -# run: | -# echo "iOS16 에서 앱 타겟을 빌드합니다." -# -# # build package 빌드 응답 커멘트 -# - name: Add Build comment -# uses: actions/github-script@v5 -# with: -# github-token: ${{secrets.GITHUB_TOKEN}} -# script: | -# github.rest.issues.createComment({ -# issue_number: context.issue.number, -# owner: context.repo.owner, -# repo: context.repo.repo, -# body: '🔨 iOS 16 iPhone 14 Pro 에서 쿠링 앱을 빌드합니다.' -# }) -# -# # 코드를 체크아웃 합니다. -# - name: Checkout repository -# uses: actions/checkout@v2 -# -# # Xcode 버전을 설정합니다. -# - name: Setup Xcode version -# uses: maxim-lobanov/setup-xcode@v1 -# with: -# xcode-version: '15.0' -# -# # KuringApp 스킴을 빌드합니다. -# - name: KuringApp 빌드 -# run: | -# cd KuringApp -# xcrun xctrace list devices -# xcodebuild clean test -project KuringApp.xcodeproj -scheme KuringApp -destination 'platform=iOS Simulator,OS=16.2,name=iPhone 14 Pro' -# -# # 빌드 성공시 커멘트 -# - name: Add Build comment -# uses: actions/github-script@v5 -# with: -# github-token: ${{secrets.GITHUB_TOKEN}} -# script: | -# github.rest.issues.createComment({ -# issue_number: context.issue.number, -# owner: context.repo.owner, -# repo: context.repo.repo, -# body: '✅ iOS16 에서 앱 타겟을 성공적으로 빌드했습니다.' -# }) -# -# # 빌드 실패시 커멘트 -# - name: Notify failure -# uses: actions/github-script@v5 -# with: -# github-token: ${{secrets.GITHUB_TOKEN}} -# script: | -# github.rest.issues.createComment({ -# issue_number: context.issue.number, -# owner: context.repo.owner, -# repo: context.repo.repo, -# body: '📬 iOS16 에서 앱 타겟 빌드에 실패했습니다. Actions에서 실패 결과를 확인해주세요.' -# }) -# if: failure() diff --git a/README.md b/README.md index 96064587..efb1b980 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,6 @@ https://www.notion.so/kuring/v2-55977b79a8014c2883ad4c89085e1464?pvs=4 반드시 `/쿠링` 으로 시작할 것. ### 빌드 -- `ios16 앱 빌드` - `ios17 앱 빌드` - `패키지 빌드`