[FEAT] ํ ํ๋ฉด ๋ฐฐ๋ ์๋ฌ ํด๊ฒฐ #94
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |