Skip to content

[FEAT] ํ™ˆ ํ™”๋ฉด ๋ฐฐ๋„ˆ ์—๋Ÿฌ ํ•ด๊ฒฐ #94

[FEAT] ํ™ˆ ํ™”๋ฉด ๋ฐฐ๋„ˆ ์—๋Ÿฌ ํ•ด๊ฒฐ

[FEAT] ํ™ˆ ํ™”๋ฉด ๋ฐฐ๋„ˆ ์—๋Ÿฌ ํ•ด๊ฒฐ #94

Workflow file for this run

name: CI
on:
pull_request:
branches: [main, develop, 'release/*']
jobs:
autocorrect:
name: ๐Ÿค– Autocorrect Workflow
runs-on: macos-15 # ์ตœ์‹  macOS 15 ํ™˜๊ฒฝ์—์„œ ์‹คํ–‰
if: github.actor != 'github-actions[bot]'&& github.base_ref == 'develop' # Actions ๋ด‡ ์ปค๋ฐ‹์€ ๋ฌด์‹œ && develop์—์„œ๋งŒ ์ž๋™ ์ˆ˜์ • ์ง„ํ–‰
steps:
- name: Checkout Repository # ์ €์žฅ์†Œ ์ฝ”๋“œ ์ฒดํฌ์•„์›ƒ
uses: actions/checkout@v4
- name: ๐Ÿ› ๏ธ Set up Xcode # Xcode 16.2 ์„ ํƒ
run: sudo xcode-select -s /Applications/Xcode_16.2.app
- name: โฌ‡๏ธ Install SwiftLint # SwiftLint ์„ค์น˜
run: brew install swiftlint
- name: ๐ŸŽจ Run SwiftLint Autocorrect # SwiftLint ์ž๋™ ์ˆ˜์ • ์‹คํ–‰
run: swiftlint --fix
- name: ๐Ÿš€ Commit and Push Changes # ๋ณ€๊ฒฝ ์‚ฌํ•ญ ์ž๋™ ์ปค๋ฐ‹ ๋ฐ ํ‘ธ์‹œ
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git fetch origin "${GITHUB_HEAD_REF}:${GITHUB_HEAD_REF}"
git checkout "${GITHUB_HEAD_REF}"
BRANCH_NAME="${GITHUB_HEAD_REF}"
if [[ "$BRANCH_NAME" =~ \#([0-9]+) ]]; then
ISSUE_NUMBER="${BASH_REMATCH[1]}"
else
ISSUE_NUMBER=""
fi
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m "style/#${ISSUE_NUMBER}: Apply SwiftLint autocorrect"
git push --set-upstream origin "${GITHUB_HEAD_REF}"
else
echo "No changes to commit"
fi
build:
name: ๐Ÿ—๏ธ Build Workflow
runs-on: macos-15 # ์ตœ์‹  macOS 15 ํ™˜๊ฒฝ์—์„œ ์‹คํ–‰
if: github.actor != 'github-actions[bot]' # Actions ๋ด‡ ์ปค๋ฐ‹์€ ๋ฌด์‹œ
steps:
- name: Checkout Repository # ์ €์žฅ์†Œ ์ฝ”๋“œ ์ฒดํฌ์•„์›ƒ
uses: actions/checkout@v4
- name: โš™๏ธ Generate xcconfig
run: |
cat <<EOF > Poppool/Poppool/Resource/Debug.xcconfig
KAKAO_AUTH_APP_KEY=${{ secrets.KAKAO_AUTH_APP_KEY }}
NAVER_MAP_CLIENT_ID=${{ secrets.NAVER_MAP_CLIENT_ID }}
POPPOOL_BASE_URL=${{ secrets.POPPOOL_BASE_URL }}
POPPOOL_S3_BASE_URL=${{ secrets.POPPOOL_S3_BASE_URL }}
POPPOOL_API_KEY=${{ secrets.POPPOOL_API_KEY }}
EOF
- name: ๐Ÿ› ๏ธ Select Xcode 16.2 # Xcode 16.2 ๋ฒ„์ „ ์‚ฌ์šฉ ์„ค์ •
run: sudo xcode-select -s /Applications/Xcode_16.2.app
- name: โฌ‡๏ธ Install SwiftLint # SwiftLint ์„ค์น˜
run: brew install swiftlint
- name: ๐ŸŽจ Run SwiftLint # SwiftLint ์ฝ”๋“œ ์Šคํƒ€์ผ ๊ฒ€์‚ฌ ์‹คํ–‰
run: swiftlint
- name: ๐Ÿ” Detect Default Scheme # ๊ธฐ๋ณธ scheme ์ž๋™ ๊ฒ€์ง€
id: detect_scheme
run: |
SCHEME=$(xcodebuild -list -json | jq -r '.project.schemes[0]')
echo "Detected scheme: $SCHEME"
echo "scheme=$SCHEME" >> "$GITHUB_OUTPUT"
- name: ๐Ÿ” Detect Latest iPhone Simulator # ์ตœ์‹  ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ iPhone ์‹œ๋ฎฌ๋ ˆ์ดํ„ฐ ๊ฒ€์ง€
id: detect_latest_simulator
run: |
DEVICE=$(xcrun simctl list devices available | grep -Eo 'iPhone .* \([0-9A-F\-]+\)' | head -n 1)
UDID=$(echo "$DEVICE" | grep -Eo '[0-9A-F\-]{36}')
NAME=$(echo "$DEVICE" | cut -d '(' -f1 | xargs)
echo "Detected simulator: $NAME ($UDID)"
echo "sim_name=$NAME" >> "$GITHUB_OUTPUT"
echo "sim_udid=$UDID" >> "$GITHUB_OUTPUT"
- name: ๐Ÿ—๏ธ Build the project # ์ž๋™ ๊ฒ€์ง€๋œ Scheme๊ณผ Simulator๋กœ ๋นŒ๋“œ ์ˆ˜ํ–‰
run: |
WORKSPACE=$(find . -name "*.xcworkspace" | head -n 1)
xcodebuild -scheme "${{ steps.detect_scheme.outputs.scheme }}" \
-workspace "$WORKSPACE" \
-destination "platform=iOS Simulator,id=${{ steps.detect_latest_simulator.outputs.sim_udid }}" \
clean build | xcpretty