Update: editor 가 close 되었을 경우에는 setViewSize 를 호출하지 않도록 수정 #5
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: Knowre Android Library CI | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| branches: [ "main" ] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| cache: gradle | |
| - name: Gradle Caching | |
| uses: actions/cache@v4.1.0 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ github.ref_name }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Run unit test | |
| run: ./gradlew testDebugUnitTest | |
| - name: Notify to slack | |
| run: | | |
| STATUS="Build Succeeded!" | |
| COLOR="good" | |
| if [[ ${{ job.status }} == "failure" ]]; then | |
| STATUS="Build Failed!" | |
| COLOR="danger" | |
| elif [[ ${{ job.status }} == "cancelled" ]]; then | |
| STATUS="Build Cancelled!" | |
| COLOR="warning" | |
| fi | |
| BUILD_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| curl -X POST -H 'Content-type: application/json' --data \ | |
| '{ | |
| "attachments": [ | |
| { | |
| "color": "'"$COLOR"'", | |
| "pretext": "'"$STATUS"'", | |
| "fields": [ | |
| { | |
| "title": "User", | |
| "value": "${{ github.actor }}", | |
| "short": true | |
| }, | |
| { | |
| "title": "Commit Message", | |
| "value": "${{ github.event.head_commit.message }}", | |
| "short": false | |
| }, | |
| { | |
| "title": "Branch", | |
| "value": "${{ github.ref_name }}", | |
| "short": true | |
| } | |
| ], | |
| "actions": [ | |
| { | |
| "type": "button", | |
| "text": "View Build", | |
| "url": "'"${BUILD_URL}"'" | |
| } | |
| ] | |
| } | |
| ] | |
| }' ${{ secrets.SLACK_WEB_HOOK_URL }} | |