From b281ab658d08f6c5fa0856550ad8631dc7eae59f Mon Sep 17 00:00:00 2001 From: stotic-dev Date: Fri, 20 Feb 2026 20:26:49 +0900 Subject: [PATCH 1/4] =?UTF-8?q?update:=20snapshot=20testing=E3=81=AFiOS17?= =?UTF-8?q?=E7=B3=BB=E3=81=A7=E5=AE=9F=E6=96=BD=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .prefire.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.prefire.yml b/.prefire.yml index c65d76b6..6f368c6b 100644 --- a/.prefire.yml +++ b/.prefire.yml @@ -2,7 +2,7 @@ test_configuration: target: homete test_target_path: ${PROJECT_DIR}/hometeSnapshotTests simulator_device: "iPhone17,3" - required_os: 18 + required_os: 17 preview_default_enabled: true use_grouped_snapshots: true sources: From eb20d2fd911a7dbea7a64f17f31789178b1251aa Mon Sep 17 00:00:00 2001 From: stotic-dev Date: Fri, 20 Feb 2026 20:30:29 +0900 Subject: [PATCH 2/4] =?UTF-8?q?update:=20Xcode=20Cloud=E3=81=A7Plugin?= =?UTF-8?q?=E3=81=AE=E8=A8=B1=E5=8F=AF=E3=82=92=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=82=B9=E3=82=AF=E3=83=AA=E3=83=97=E3=83=88=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ci_scripts/ci_post_clone.sh | 5 +++++ 1 file changed, 5 insertions(+) create mode 100755 ci_scripts/ci_post_clone.sh diff --git a/ci_scripts/ci_post_clone.sh b/ci_scripts/ci_post_clone.sh new file mode 100755 index 00000000..e9818c38 --- /dev/null +++ b/ci_scripts/ci_post_clone.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +# Xcode CloudでSwift Package Managerプラグインの検証をスキップする +# PrefireTestsPluginなどのパッケージプラグインを許可するために必要 +defaults write com.apple.dt.Xcode IDESkipPackagePluginFingerprintValidatation -bool YES From 61f42ad379d70f0c8781e0c82ae207dc3bfbdbd2 Mon Sep 17 00:00:00 2001 From: stotic-dev Date: Sat, 21 Feb 2026 12:09:30 +0900 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20Xcode=20Cloud=E3=81=A7Danger?= =?UTF-8?q?=E3=82=92=E5=AE=9F=E8=A1=8C=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProjectTools/Dangerfile.swift | 3 ++- ci_scripts/ci_post_xcodebuild.sh | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100755 ci_scripts/ci_post_xcodebuild.sh diff --git a/ProjectTools/Dangerfile.swift b/ProjectTools/Dangerfile.swift index 88781a09..994c3783 100644 --- a/ProjectTools/Dangerfile.swift +++ b/ProjectTools/Dangerfile.swift @@ -75,7 +75,8 @@ for targetInfo in lintTargets { ) } -let resultBundlePath = "Build/test.xcresult" +// Xcode Cloudでは CI_RESULT_BUNDLE_PATH 環境変数にxcresultのパスが入る +let resultBundlePath = ProcessInfo.processInfo.environment["CI_RESULT_BUNDLE_PATH"] ?? "Build/test.xcresult" // Code Coverageの確認 diff --git a/ci_scripts/ci_post_xcodebuild.sh b/ci_scripts/ci_post_xcodebuild.sh new file mode 100755 index 00000000..3adcf48a --- /dev/null +++ b/ci_scripts/ci_post_xcodebuild.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +# DANGER_ENABLEDが設定されていない場合はスキップ(Xcode Cloudの環境変数で制御) +if [ "$DANGER_ENABLED" != "YES" ]; then + echo "DANGER_ENABLED=YES が設定されていないためDangerをスキップします" + exit 0 +fi + +# PRビルド時のみ実行 +if [ -z "$CI_PULL_REQUEST_NUMBER" ]; then + echo "PRビルドではないためDangerをスキップします" + exit 0 +fi + +echo "Dangerを実行します (PR #${CI_PULL_REQUEST_NUMBER})" + +# DangerJS(danger-swiftが依存)をインストール +npm install -g danger + +# ProjectToolsディレクトリでビルドして実行(ci.ymlと同じ方法) +cd "$CI_WORKSPACE/ProjectTools" +swift build +swift run danger-swift ci --cwd ../ From 5ec6d0ab4104bb786387f5233f248c3c4a08df64 Mon Sep 17 00:00:00 2001 From: stotic-dev Date: Sat, 21 Feb 2026 12:34:32 +0900 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20VRT=E3=82=92ci=E3=81=A7=E8=A1=8C?= =?UTF-8?q?=E3=82=8F=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd_release.yml | 4 +- .github/workflows/cd_testFlight.yml | 4 +- .github/workflows/ci.yml | 153 ---------------------------- 3 files changed, 6 insertions(+), 155 deletions(-) delete mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/cd_release.yml b/.github/workflows/cd_release.yml index 75c3ba77..547076c9 100644 --- a/.github/workflows/cd_release.yml +++ b/.github/workflows/cd_release.yml @@ -4,7 +4,9 @@ name: deploy_app_store on: - workflow_call: + push: + branches: + - "release/*" env: # チェックアウト diff --git a/.github/workflows/cd_testFlight.yml b/.github/workflows/cd_testFlight.yml index fddf6783..80a476b6 100644 --- a/.github/workflows/cd_testFlight.yml +++ b/.github/workflows/cd_testFlight.yml @@ -4,7 +4,9 @@ name: deploy_test_flight on: - workflow_call: + push: + branches: + - "main" env: # チェックアウト diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index a111680c..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,153 +0,0 @@ -# This workflow will build a Swift project -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift - -name: build_test - -on: - push: - branches: - - "main" - - "release/*" - pull_request: - branches: - - "**" - paths-ignore: - - ".github/ISSUE_TEMPLATE/*" - - ".gitignore" - - README.md - workflow_dispatch: - -env: - # チェックアウト - DEVELOPER_DIR: /Applications/Xcode_26.1.1.app - WORKSPACE_DIR: homete.xcodeproj - BUILD_SCHEME: homete - TEST_PLAN: CI - SPM_CLONE_PATH: SourcePackages - SPM_PACKAGE_RESOLVED_FILE_PATH: homete.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved - PROJECT_TOOLS_SPM_PACKAGE_RESOLVED_FILE_PATH: ProjectTools/Package.resolved - TEST_OUTPUT_PATH: Build/test.xcresult - ARTIFACTS_PATH: Artifacts - -jobs: - build: - # 実行環境はmacosに設定 - runs-on: macos-15 - env: - SNAPSHOT_FAILURES_PATH: Build/VRT/SnapshotsFailures - - steps: - # チェックアウト(リポジトリからソースコードを取得) - - uses: actions/checkout@v4.2.2 - with: - fetch-depth: 0 - - - name: Get latest commit of default branch - id: get_commit - run: | - DEFAULT_BRANCH=${{ github.event.repository.default_branch }} - git fetch origin $DEFAULT_BRANCH - LATEST_COMMIT=$(git rev-parse origin/$DEFAULT_BRANCH) - echo "LATEST_COMMIT=$LATEST_COMMIT" - echo "commit_sha=$LATEST_COMMIT" >> $GITHUB_OUTPUT - - # Xcodeの一覧出力 - - name: Show Xcode list - run: ls /Applications | grep 'Xcode' - - # Xcodeのバージョン選択 - - name: Select Xcode version - run: sudo xcode-select -s '${{ env.DEVELOPER_DIR }}/Contents/Developer' - - # Xcodeのバージョン出力 - - name: Show Xcode version - run: xcodebuild -version - - # SPMのライブラリのキャッシュ - - name: Cache Swift Packages For ProjectTools - uses: actions/cache@v4 - with: - path: ProjectTools/.build - key: v1-project-tools-${{ runner.os }}-spm-${{ hashFiles(env.PROJECT_TOOLS_SPM_PACKAGE_RESOLVED_FILE_PATH) }} - restore-keys: v1-project-tools-${{ runner.os }}-spm- - - # SPMのライブラリのキャッシュ - - name: Cache Swift Packages For Project - uses: actions/cache@v4 - with: - path: ${{ env.SPM_CLONE_PATH }} - key: v1-dev-${{ runner.os }}-spm-${{ hashFiles(env.SPM_PACKAGE_RESOLVED_FILE_PATH) }} - restore-keys: v1-dev-${{ runner.os }}-spm- - - - name: Decode Firebase Api Key - run: echo "${{ secrets.DEV_FIREBASE_API_KEY_BASE64 }}" | base64 --decode > homete/GoogleService-Info-dev.plist - - - name: Xcode Resolve Package Dependencies - run: set -o pipefail && - xcodebuild - -project "${WORKSPACE_DIR}" - -scheme "${BUILD_SCHEME}" - -configuration Debug - -clonedSourcePackagesDirPath "${SPM_CLONE_PATH}" - -skipPackagePluginValidation - -skipMacroValidation - -scmProvider xcode - -resolvePackageDependencies - - # 単体テストの実行 - - name: Xcode test - run: set -o pipefail && - xcodebuild - -project "${WORKSPACE_DIR}" - -configuration Debug - -destination 'platform=iOS Simulator,OS=18.6,name=iPhone 16' - -scheme "${BUILD_SCHEME}" - -testPlan "${TEST_PLAN}" - -skipPackagePluginValidation - -clonedSourcePackagesDirPath "${SPM_CLONE_PATH}" - -resultBundlePath "${TEST_OUTPUT_PATH}" - clean test | - xcbeautify --renderer github-actions - - # DangerJSをインストール - - name: Install Danger JS - if: github.event_name == 'pull_request' - run: npm install -g danger - - # Dangerの実行 - - name: Static Analyze with Danger - if: github.event_name == 'pull_request' - run: | - swift build - swift run danger-swift ci --cwd ../ - working-directory: ProjectTools - env: - DANGER_GITHUB_API_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }} - - - name: Compress Test Result - if: always() - run: | - mkdir -p ${{ env.ARTIFACTS_PATH }} - zip -r ${{ env.ARTIFACTS_PATH }}/test_result.zip ${{ env.TEST_OUTPUT_PATH }} - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - if: always() - with: - name: artifacts - path: ${{ env.ARTIFACTS_PATH }} - retention-days: 1 - - # Deploy(TestFlight) - call_deploy: - if: github.ref_name == 'main' - needs: build - uses: ./.github/workflows/cd_testFlight.yml - secrets: inherit - - # Deploy(Release) - call_deploy_release: - if: github.ref_name == 'release/*' - needs: build - uses: ./.github/workflows/cd_release.yml - secrets: inherit