Skip to content

[chore] 기초 세팅 / Github Actions 세팅, KtLint 적용 #4

[chore] 기초 세팅 / Github Actions 세팅, KtLint 적용

[chore] 기초 세팅 / Github Actions 세팅, KtLint 적용 #4

Workflow file for this run

name: Winey PR Checker
on:
pull_request:
branches: [ develop, main ]
defaults:
run:
shell: bash
working-directory: .
jobs:
build:
name: PR Checker
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Gradle cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Change gradlew permissions
run: chmod +x ./gradlew
- name: Add Local Properties
env:
AUTH_BASE_URL: ${{ secrets.AUTH_BASE_URL }}
run: |
echo auth.base.url=$AUTH_BASE_URL >> ./local.properties
- name: Build debug APK
run: bash ./gradlew assembleDebug --stacktrace
- name: Upload APK
uses: actions/upload-artifact@v1
with:
name: app
path: app/build/outputs/apk/debug
- name: Run ktlint
run: ./gradlew ktlintCheck
- name: On Success, Notify in Slack
if: ${{ success() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: '#53A551'
SLACK_ICON: https://github.com/team-winey/Winey-AOS/assets/68090939/d9f94086-84f5-4ef2-80b4-acf27b59c21b?size=48
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_TITLE: 'ALL Winey Android Makers checks have passed ✅'
MSG_MINIMAL: true
SLACK_USERNAME: Winey Android
SLACK_MESSAGE: 'Winey Android PR check 성공 🎉🎉🎉'
- name: On Failed, Notify in Slack
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: '#ff0000'
SLACK_ICON: https://github.com/team-winey/Winey-AOS/assets/68090939/d9f94086-84f5-4ef2-80b4-acf27b59c21b?size=48
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_TITLE: 'Winey checks have failed 🚫'
MSG_MINIMAL: true
SLACK_USERNAME: Winey Android
SLACK_MESSAGE: '버그 잡자 🐛'