[feat] 네트워크 모듈 생성 및 구현 #15
This file contains 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: | |
push: | |
branches: | |
- main | |
- develop | |
pull_request: | |
concurrency: | |
group: build-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build and Test | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
security-events: write | |
steps: | |
# 1. Checkout code | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# 2. Set up JDK | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
# 3. Cache Gradle | |
- name: Cache Gradle | |
uses: actions/cache@v3 | |
with: | |
path: ~/.gradle/caches | |
key: gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
gradle- | |
# 4. Add Local Properties | |
- name: Add Local Properties | |
env: | |
BASE_URL: ${{ secrets.BASE_URL }} | |
run: | | |
echo base.url=\"$BASE_URL\" >> ./local.properties | |
# 5. Run Static Analysis (Detekt) | |
- name: Run Detekt | |
run: ./gradlew detekt | |
# 6. Check Code Formatting (Spotless) | |
- name: Run Spotless Check | |
run: ./gradlew spotlessCheck | |
# # 6. Run Unit Tests | |
# - name: Run Unit Tests | |
# run: ./gradlew test | |
# 7. Run Lint | |
- name: Run Lint | |
run: ./gradlew lint | |
# 8. Build APK | |
- name: Build APK | |
run: ./gradlew assembleDebug | |
# 9. Upload Artifacts | |
- name: Upload APKs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: APKs | |
path: '**/build/outputs/apk/**/*.apk' | |
- name: Upload Test Results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Test Results | |
path: '**/build/test-results/**/*.xml' | |
# 10. Notify in Slack | |
- name: Notify in Slack | |
uses: 8398a7/action-slack@v3 | |
with: | |
status: ${{job.status}} | |
fields: repo,message,commit,author,action,eventName,ref,workflow | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
if: always() |