포커싱 검색 결과 화면에 더보기 기능을 추가한다 #48
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: Android CI | |
| on: | |
| pull_request: | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| ci-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Setup JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| cache: gradle | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v2 | |
| - name: Cache Gradle Wrapper | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle-wrapper- | |
| - name: Cache Build Cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.gradle/caches/build-cache-1 | |
| key: ${{ runner.os }}-build-cache-${{ hashFiles('**/build.gradle*', '**/gradle-wrapper.properties') }}-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-build-cache-${{ hashFiles('**/build.gradle*', '**/gradle-wrapper.properties') }} | |
| ${{ runner.os }}-build-cache- | |
| - name: Generate local.properties | |
| run: echo '${{ secrets.LOCAL_PROPERTIES }}' | base64 -d > ./local.properties | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Code Style Check | |
| id: ktlint | |
| run: | | |
| start=$(date +%s) | |
| ./gradlew ktlintCheck detekt --parallel | |
| end=$(date +%s) | |
| echo "time=$((end-start))" >> $GITHUB_OUTPUT | |
| - name: Unit Test | |
| id: test | |
| run: | | |
| start=$(date +%s) | |
| ./gradlew testDebugUnitTest --parallel | |
| end=$(date +%s) | |
| echo "time=$((end-start))" >> $GITHUB_OUTPUT | |
| - name: Debug Build with Gradle | |
| id: assemble | |
| run: | | |
| start=$(date +%s) | |
| ./gradlew buildDebug --stacktrace --build-cache --parallel | |
| end=$(date +%s) | |
| echo "time=$((end-start))" >> $GITHUB_OUTPUT | |
| - name: Create CI summary | |
| if: always() | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const results = { | |
| test: { | |
| status: '${{ steps.test.outcome }}', | |
| name: 'Unit Test', | |
| time: '${{ steps.test.outputs.time }}' | |
| }, | |
| assemble: { | |
| status: '${{ steps.assemble.outcome }}', | |
| name: 'Debug Build', | |
| time: '${{ steps.assemble.outputs.time }}' | |
| }, | |
| ktlint: { | |
| status: '${{ steps.ktlint.outcome }}', | |
| name: 'Code Style Check', | |
| time: '${{ steps.ktlint.outputs.time }}' | |
| } | |
| }; | |
| const emoji = { | |
| success: '✅', | |
| failure: '❌', | |
| cancelled: '⚠️', | |
| skipped: '⏭️' | |
| }; | |
| const runUrl = `https://github.com/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`; | |
| function formatTime(seconds) { | |
| seconds = parseInt(seconds || 0, 10); | |
| if (seconds >= 60) { | |
| const min = Math.floor(seconds / 60); | |
| const sec = seconds % 60; | |
| return `${min}m ${sec}s`; | |
| } | |
| return `${seconds}s`; | |
| } | |
| const totalTime = Object.values(results) | |
| .reduce((acc, step) => acc + parseInt(step.time || 0), 0); | |
| let body = `## 🤖 Android CI Summary\n\n**Step Results:**\n`; | |
| for (const step of Object.values(results)) { | |
| const statusEmoji = emoji[step.status] || step.status; | |
| const statusText = step.status === 'success' ? 'Success' : (step.status === 'failure' ? 'Failure' : 'Skipped'); | |
| body += `- **${step.name}**: ${statusEmoji} ${statusText} (${formatTime(step.time)})\n`; | |
| } | |
| body += `\n**Total Time:** **${formatTime(totalTime)}**\n`; | |
| const failedSteps = Object.values(results) | |
| .filter(step => step.status !== 'success') | |
| .map(step => step.name); | |
| if (failedSteps.length > 0) { | |
| body += `\n⚠️ **Warning:** The following steps failed: **${failedSteps.join(', ')}**\n`; | |
| body += `See the [Actions Log](${runUrl}) for details.\n`; | |
| } else { | |
| body += `\n🎉 All steps completed successfully!`; | |
| } | |
| github.rest.pulls.createReview({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: context.issue.number, | |
| event: 'COMMENT', | |
| body | |
| }); |