Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
2435474
test: ci v0
opficdev Jan 30, 2026
9e0c322
test: ci v1
opficdev Jan 30, 2026
56da50b
test: ci v2
opficdev Jan 30, 2026
c4e3896
test: ci v3
opficdev Jan 30, 2026
8ee1396
test: ci v4
opficdev Jan 30, 2026
a60152a
test: ci v5
opficdev Jan 30, 2026
676f29f
test: ci v6
opficdev Jan 30, 2026
d3406cb
test: ci v7
opficdev Jan 30, 2026
cc3c16a
test: ci v8
opficdev Jan 30, 2026
e515821
Update build.yml
opficdev Jan 30, 2026
3a118d8
Update build.yml
opficdev Jan 30, 2026
b0db5ee
Update build.yml
opficdev Jan 30, 2026
9ace23c
Update build.yml
opficdev Jan 30, 2026
23e5002
Update build.yml
opficdev Jan 30, 2026
b0b1a1b
Update build.yml
opficdev Jan 30, 2026
30d007a
Update build.yml
opficdev Jan 30, 2026
12fd48b
Update build.yml
opficdev Jan 30, 2026
52109c0
Update build.yml
opficdev Jan 30, 2026
9ed6e2f
Update build.yml
opficdev Jan 30, 2026
773e5cd
Update build.yml
opficdev Jan 30, 2026
85a5d90
Update build.yml
opficdev Jan 30, 2026
2b964c2
Update build.yml
opficdev Jan 30, 2026
ff1ffca
Update build.yml
opficdev Jan 30, 2026
1cb2499
Update build.yml
opficdev Jan 30, 2026
9047e1c
Update build.yml
opficdev Jan 30, 2026
dc05757
Update build.yml
opficdev Jan 30, 2026
35d5ff9
Update build.yml
opficdev Jan 30, 2026
7e19e1d
Update build.yml
opficdev Jan 30, 2026
af52365
Update build.yml
opficdev Jan 30, 2026
fb8ecb1
Update build.yml
opficdev Jan 30, 2026
c502d7b
Update build.yml
opficdev Jan 30, 2026
8e75291
Update build.yml
opficdev Jan 30, 2026
08e6ff1
Update build.yml
opficdev Jan 30, 2026
75e6d38
Update build.yml
opficdev Jan 30, 2026
5e8d2dd
Update build.yml
opficdev Jan 30, 2026
82a9264
Update build.yml
opficdev Jan 30, 2026
c06721c
Update build.yml
opficdev Jan 30, 2026
4e6aff8
Update build.yml
opficdev Jan 30, 2026
5c8298f
Update build.yml
opficdev Jan 30, 2026
b13080a
Update build.yml
opficdev Jan 30, 2026
515cf17
Update build.yml
opficdev Jan 30, 2026
c7aedea
Update build.yml
opficdev Jan 30, 2026
ca0cf8c
Update build.yml
opficdev Jan 30, 2026
ab0fe51
Update build.yml
opficdev Jan 30, 2026
a212cc2
Update build.yml
opficdev Jan 30, 2026
4049974
Update build.yml
opficdev Jan 31, 2026
4190bc2
fix: ContentView 제거
opficdev Jan 31, 2026
0288773
chore: TempView로 변경
opficdev Jan 31, 2026
aa4d6e3
Update build.yml
opficdev Jan 31, 2026
2f68ab3
Update SettingView.swift
opficdev Jan 31, 2026
ae0afea
Update build.yml
opficdev Jan 31, 2026
b344516
Update build.yml
opficdev Jan 31, 2026
f9b3cb2
Update build.yml
opficdev Jan 31, 2026
6a70d32
Update build.yml
opficdev Jan 31, 2026
77d9c35
Update build.yml
opficdev Jan 31, 2026
55592b8
Update build.yml
opficdev Jan 31, 2026
0f5be5f
Update SettingView.swift
opficdev Jan 31, 2026
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
233 changes: 233 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
name: iOS CI

on:
pull_request:

env:
SCHEME: DevLog

permissions:
contents: read
issues: write
pull-requests: write
checks: write

jobs:
build:
runs-on: macos-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4

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

- name: Cache SwiftPM
uses: actions/cache@v4
with:
path: |
~/.swiftpm
~/Library/Caches/org.swift.swiftpm
~/Library/Developer/Xcode/SourcePackages
.spm
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-


- name: Select iOS Simulator Runtime (installed)
id: pick_ios
shell: bash
run: |
set -euo pipefail

# macOS 메인 버전에 맞는 iOS 버전 중 최신 버전의 iPhone 선택
RESULT=$(python3 - <<'PY'
import re, subprocess, sys

xcode_ver = subprocess.check_output(["xcodebuild", "-version"], text=True).splitlines()[0].strip()
xcode_major = xcode_ver.split()[1].split('.')[0]
try:
xcode_major_num = int(xcode_major)
except ValueError:
xcode_major_num = None
if xcode_major_num is not None and xcode_major_num <= 15:
xcode_major = "26"

text = subprocess.check_output(["xcrun", "simctl", "list", "devices"], text=True)
lines = text.splitlines()

def ver_key(v):
return tuple(int(x) for x in v.split('.'))

# 1) 최신 iOS 버전(해당 mac 메이저) 찾기
latest_ver = None
for line in lines:
header = re.match(r"^-- iOS ([0-9]+(?:\.[0-9]+)*) --$", line.strip())
if not header:
continue
ver = header.group(1)
if not ver.startswith(f"{xcode_major}."):
continue
if latest_ver is None or ver_key(ver) > ver_key(latest_ver):
latest_ver = ver

if latest_ver is None:
print(f"No iOS versions found for Xcode major {xcode_major}", file=sys.stderr)
sys.exit(1)

# 2) 해당 버전 섹션에서 첫 iPhone 찾고 즉시 종료
current_ver = None
for line in lines:
header = re.match(r"^-- iOS ([0-9]+(?:\.[0-9]+)*) --$", line.strip())
if header:
current_ver = header.group(1)
continue
if current_ver != latest_ver:
continue
if "(unavailable)" in line:
continue
if "iPhone" in line:
raw = line.strip()
# key:value 형태면 딕셔너리로 파싱해서 name만 사용
if "platform:" in raw and "name:" in raw and "OS:" in raw:
kv = {}
for part in raw.split(","):
if ":" not in part:
continue
k, v = part.split(":", 1)
kv[k.strip()] = v.strip()
name = kv.get("name", raw)
else:
name = raw
# UUID/상태만 제거하고 모델명 괄호는 유지
name = re.sub(r"\s+\([0-9A-Fa-f-]{36}\)\s+\(.*\)$", "", name)
print(f"{latest_ver}|{name}")
sys.exit(0)

print(f"No iPhone candidates found for iOS {latest_ver}", file=sys.stderr)
sys.exit(1)
PY
)

if [ -z "${RESULT:-}" ]; then
echo "No iPhone simulator devices detected." >&2
exit 1
fi

IFS='|' read -r IOS_VER DEVICE_NAME <<< "$RESULT"

echo "Chosen iOS runtime version (iPhone): $IOS_VER"
echo "Chosen simulator: $DEVICE_NAME"

echo "ios_version=$IOS_VER" >> "$GITHUB_OUTPUT"
echo "device_name=$DEVICE_NAME" >> "$GITHUB_OUTPUT"

- name: Build
shell: bash
run: |
set -euo pipefail
set -x
IOS_VER="${{ steps.pick_ios.outputs.ios_version }}"
DEVICE_NAME="${{ steps.pick_ios.outputs.device_name }}"
SPM_DIR="$GITHUB_WORKSPACE/.spm"
mkdir -p "$SPM_DIR"

xcodebuild -version

echo "Using scheme: $SCHEME"

echo "Using simulator: $DEVICE_NAME (iOS ${IOS_VER})"

set -o pipefail
set +e
echo "== Resolving Swift Package dependencies =="
xcodebuild \
-scheme "$SCHEME" \
-configuration Debug \
-clonedSourcePackagesDirPath "$SPM_DIR" \
-resolvePackageDependencies
echo "== Starting xcodebuild build =="
xcodebuild \
-scheme "$SCHEME" \
-configuration Debug \
-destination "platform=iOS Simulator,OS=${IOS_VER},name=${DEVICE_NAME}" \
-clonedSourcePackagesDirPath "$SPM_DIR" \
-skipPackagePluginValidation \
-skipMacroValidation \
-showBuildTimingSummary \
build \
| tee build.log
echo "== xcodebuild finished =="
XC_STATUS=${PIPESTATUS[0]}
set -e

if [ -f build.log ]; then
echo "== error: lines =="
if grep -i "error:" build.log; then
if [ "$XC_STATUS" -eq 0 ]; then
XC_STATUS=1
fi
fi
fi

exit $XC_STATUS

- name: Comment build failure on PR
if: failure() && github.event.pull_request.head.repo.fork == false
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const path = 'build.log';
let body = '❌ iOS CI build failed.\n\n';
if (fs.existsSync(path)) {
const log = fs.readFileSync(path, 'utf8');
const lines = log.split(/\r?\n/);
const errorLines = lines.filter((line) => /error:/i.test(line));
if (errorLines.length > 0) {
body += "Lines containing 'error:':\n\n```\n" + errorLines.join('\n') + '\n```\n';

const repoRoot = process.env.GITHUB_WORKSPACE || process.cwd();
const pathMod = require('path');
const snippets = [];
for (const line of errorLines) {
const match = line.match(/^(.*?):(\d+):(\d+):\s+error:/);
if (!match) continue;
const filePath = match[1];
const lineNum = parseInt(match[2], 10);
const absPath = filePath.startsWith('/') ? filePath : pathMod.join(repoRoot, filePath);
if (!fs.existsSync(absPath)) continue;
const fileLines = fs.readFileSync(absPath, 'utf8').split(/\r?\n/);
const start = Math.max(0, lineNum - 3);
const end = Math.min(fileLines.length, lineNum + 2);
const snippet = fileLines
.slice(start, end)
.map((l, idx) => {
const ln = start + idx + 1;
return `${ln.toString().padStart(4, ' ')}| ${l}`;
})
.join('\n');
snippets.push(`File: ${filePath}:${lineNum}\n${snippet}`);
}
if (snippets.length > 0) {
body += "\nCode excerpts:\n\n```\n" + snippets.join('\n\n') + "\n```\n";
}
} else {
body += "No lines containing 'error:' were found in build.log.";
}
} else {
body += 'build.log not found.';
}
if (!context.payload.pull_request) {
core.info('No PR context; skipping comment.');
return;
}
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
body
});
16 changes: 16 additions & 0 deletions DevLog/App/TempView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// TempView.swift
// DevLog
//
// Created by 최윤진 on 1/31/26.
//

import SwiftUI

struct TempView: View {
let text: String

var body: some View {
Text(text)
}
}
2 changes: 1 addition & 1 deletion DevLog/UI/Setting/SettingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ struct SettingView: View {
)
)
case .account:
ContentView(text: "계정 연동 화면")
TempView(text: "AccountView")
// AccountView(viewModel: viewModel)
}
}
Expand Down