-
Notifications
You must be signed in to change notification settings - Fork 0
[FEAT] CI & Swiftlint autocorrect 깃허브 액션 추가 #98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
f7e5439
remove/#93: 컨벤션 파일 삭제
0Hooni 4795a0a
chore/#93: 빌드 파일 수정
0Hooni 847a725
chore/#93: 프로젝트 세팅 수정
0Hooni 6cec4f8
add/#93: swiftlint rule 파일 추가
0Hooni 5782305
chore/#93: SwiftLint rule 파일 기본 세팅
0Hooni 1541948
remove#93: 불필요한 파일 삭제
0Hooni 8e0e591
docs/#93: SwiftLint 문법 수정
0Hooni ab6df32
feat/#93: Swiftlint 자동 수정 깃허브 액션 추가
0Hooni 3fd8a70
remove/#93: 사용하지 않는 테스트 타겟 제거
0Hooni e3cdf10
feat/#93: CI 깃허브 액션 추가
0Hooni 4420daf
fix/#93: CI가 깃액션 봇의 커밋은 무시하도록 수정
0Hooni 2fcd2cf
chore/#93: Debug.xcconfig로 대체하기 위한 빌드 설정 수정
0Hooni 37a7022
chore/#93: gitignore 수정 및 정리
0Hooni 46b9311
refactor/#93: 변경 된 키 저장 방식에 맞게 키 호출 코드 수정
0Hooni 7af96b8
refactor/#93: GitHubActions 파일 추가 수정
0Hooni fb7918f
chore/#93: CI에 Debug.xcconfig 생성 스텝 추가
0Hooni b00d50b
refactor/#93: Secrets.swift 제거
0Hooni f958ff6
refactor/#93: Secrets enum → KeyPath enum 변경 대응
0Hooni 334a4a3
chore/#93: CI 태스크 이름 수정
0Hooni 2253ee8
test/#93: CI 테스트를 위한 임시 swiftlint룰 적용
0Hooni 3d31395
refactor/#93: CI, AutoCorrect 통합
0Hooni 05e9118
fix/#93: 린트 자동수정 명령어 수정
0Hooni eac393c
fix/#93: 린트 자동수정 에러 수정 및 빌드파일 경로 탐지 추가
0Hooni ee45fe3
fix/#93: 이슈번호 검출 정규표현식 개선 및 린트 자동수정 커밋 에러 해결
0Hooni 50f48c8
fix/#93: 자동수정 커밋 액션 No upstream branch 에러 수정
0Hooni 13b2b64
style/#93: Apply SwiftLint autocorrect
github-actions[bot] 5decd58
Merge branch 'dev' of https://github.com/PopPool/iOS into style/#93-a…
0Hooni 82931e9
refactor/#93: Swiftlint 에러 수정
0Hooni 81f4aaf
style/#93: Apply SwiftLint autocorrect
github-actions[bot] 7177fc0
style/#93: 코드 스타일에 맞게 일부 코드 수정
0Hooni File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [dev] | ||
| push: | ||
| branches: [dev] | ||
|
|
||
| jobs: | ||
| autocorrect: | ||
| name: 🤖 Autocorrect Workflow | ||
| runs-on: macos-15 # 최신 macOS 15 환경에서 실행 | ||
| if: github.actor != 'github-actions[bot]' # Actions 봇 커밋은 무시 | ||
|
|
||
| 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 | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,65 +1,43 @@ | ||
| # Xcode | ||
| # | ||
| # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore | ||
|
|
||
| ## User settings | ||
| # Xcode 관련 | ||
| xcuserdata/ | ||
| .DS_Store | ||
|
|
||
| # 개인 설정 및 비밀 정보 | ||
| *.xcconfig | ||
|
|
||
| ## Obj-C/Swift specific | ||
| # Objective-C / Swift 관련 | ||
| *.hmap | ||
|
|
||
| ## App packaging | ||
| # 앱 패키징 | ||
| *.ipa | ||
| *.dSYM.zip | ||
| *.dSYM | ||
|
|
||
| ## Playgrounds | ||
| # Playgrounds | ||
| timeline.xctimeline | ||
| playground.xcworkspace | ||
|
|
||
| # Swift Package Manager | ||
| # | ||
| # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. | ||
| # Swift Package Manager (SPM) | ||
| .build/ | ||
| # 패키지 관련 파일을 무시하고 싶다면 아래 항목을 활성화하세요. | ||
| # Packages/ | ||
| # Package.pins | ||
| # Package.resolved | ||
| # *.xcodeproj | ||
| # | ||
| # Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata | ||
| # hence it is not needed unless you have added a package configuration file to your project | ||
| # .swiftpm | ||
|
|
||
| .build/ | ||
|
|
||
| # CocoaPods | ||
| # | ||
| # We recommend against adding the Pods directory to your .gitignore. However | ||
| # you should judge for yourself, the pros and cons are mentioned at: | ||
| # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control | ||
| # | ||
| # Pods 디렉토리를 무시하고 싶다면 아래 항목을 활성화하세요. | ||
| # Pods/ | ||
| # | ||
| # Add this line if you want to avoid checking in source code from the Xcode workspace | ||
| # *.xcworkspace | ||
|
|
||
| # Carthage | ||
| # | ||
| # Add this line if you want to avoid checking in source code from Carthage dependencies. | ||
| # Carthage/Checkouts | ||
|
|
||
| Carthage/Build/ | ||
| # Carthage 의존성을 무시하고 싶다면 아래 항목을 활성화하세요. | ||
| # Carthage/Checkouts | ||
|
|
||
| # fastlane | ||
| # | ||
| # It is recommended to not store the screenshots in the git repo. | ||
| # Instead, use fastlane to re-generate the screenshots whenever they are needed. | ||
| # For more information about the recommended setup visit: | ||
| # https://docs.fastlane.tools/best-practices/source-control/#source-control | ||
|
|
||
| fastlane/report.xml | ||
| fastlane/Preview.html | ||
| fastlane/screenshots/**/*.png | ||
| fastlane/test_output | ||
|
|
||
| .DS_Store | ||
| Secrets.swift |
0Hooni marked this conversation as resolved.
Show resolved
Hide resolved
|
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # 기본 활성화된 룰 중에 비활성화할 룰을 지정 | ||
| disabled_rules: | ||
| - type_body_length | ||
| - function_body_length | ||
| - file_length | ||
| - line_length | ||
| - force_cast | ||
| - force_try | ||
| - duplicate_conditions | ||
| - identifier_name | ||
| - cyclomatic_complexity | ||
| - redundant_optional_initialization | ||
|
|
||
| # 기본(default) 룰이 아닌 룰들을 활성화 | ||
| opt_in_rules: | ||
| - sorted_imports | ||
| - direct_return | ||
| - file_header | ||
| - weak_delegate |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build Flow를 여기서 정의하는 걸까요..? 신기합니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dongglehada
ci 내부에 여러 jobs을 둘 수 있고 현재 총 두개의 job을 두고 있습니다.
이 두가지의 작업이 성공적으로 끝나면 PR이 병합될 수 있는 상태로 판단해줍니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
친절한 설명감사합니다.. 확인했습니다!