Dev #16
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: Android CI | |
| # 워크플로우가 실행될 조건 (Triggers) | |
| on: | |
| push: | |
| branches: [ "main", "develop" ] # 브랜치에 push될 때 | |
| pull_request: | |
| branches: [ "main", "develop" ] # 브랜치로 pull request가 생성될 때 | |
| workflow_dispatch: # Github Actions 수동으로 실행될 때 | |
| # 실행될 작업(Job) 목록 | |
| jobs: | |
| build: | |
| # 작업이 실행될 환경 | |
| runs-on: ubuntu-latest | |
| # 작업의 단계(Step)들 | |
| steps: | |
| # 1. 저장소의 코드를 runner로 가져오기 (Checkout) | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # 2. JDK 17 버전 설정하기 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| # 3. Gradle 캐시 설정 (빌드 속도 향상) | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v3 | |
| # 4. gradlew 파일에 실행 권한 부여 | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x ./gradlew | |
| # 5. KtLint로 코드 스타일 검사 | |
| - name: Run KtLint Check | |
| run: ./gradlew ktlintCheck | |
| # 6. 유닛 테스트 실행 | |
| - name: Run unit tests | |
| run: ./gradlew testDebugUnitTest | |
| # 7. 디버그 버전으로 앱 빌드 | |
| - name: Build with Gradle | |
| run: ./gradlew assembleDebug |