Skip to content

Commit

Permalink
[CI/CD] ktlint, unit test workFlow 파일 분리
Browse files Browse the repository at this point in the history
  • Loading branch information
murjune committed Sep 22, 2024
1 parent 0bd8290 commit 9b653e5
Show file tree
Hide file tree
Showing 5 changed files with 122 additions and 370 deletions.
45 changes: 45 additions & 0 deletions .github/actions/ktlint_check/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: 'ktLint Check'

description: 'Run ktLint Check using Gradle'

inputs:
BASE_URL:
description: 'Base URL for local.properties'
required: true

runs:
using: 'composite'
steps:

- 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: Create Local Properties
shell: bash
run: touch local.properties

- name: Access Local Properties
shell: bash
run: |
echo POKE_BASE_URL=\"${{ inputs.POKE_BASE_URL }}\" >> local.properties
- name: Grant execute permission for gradlew
shell: bash
run: chmod +x gradlew

- name: Lint Check
shell: bash
run: ./gradlew ktlintCheck
66 changes: 66 additions & 0 deletions .github/actions/unit_test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: 'Test Alpha Unit Test'

description: 'Run Alpha Unit Tests using Gradle'

inputs:
POKE_BASE_URL:
description: 'Base URL for local.properties'
required: true
GOOGLE_SERVICES_ALPHA:
description: 'Google Services JSON for alpha build'
required: true
GOOGLE_SERVICES_BETA:
description: 'Google Services JSON for beta build'
required: true
GOOGLE_SERVICES:
description: 'Google Services JSON for release'
required: true

runs:
using: 'composite'
steps:
- 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: Create Google-Services.json
shell: bash
run: |
touch ./app/src/debug/google-services.json
touch ./app/src/alpha/google-services.json
touch ./app/src/beta/google-services.json
mkdir ./app/src/release
touch ./app/src/release/google-services.json
echo ${{ inputs.GOOGLE_SERVICES_ALPHA }} >> ./app/src/debug/google-services.json
echo ${{ inputs.GOOGLE_SERVICES_ALPHA }} >> ./app/src/alpha/google-services.json
echo ${{ inputs.GOOGLE_SERVICES_BETA }} >> ./app/src/beta/google-services.json
echo ${{ inputs.GOOGLE_SERVICES }} >> ./app/src/release/google-services.json
- name: Create Local Properties
shell: bash
run: touch local.properties

- name: Access Local Properties
shell: bash
run: |
echo POKE_BASE_URL=\"${{ inputs.POKE_BASE_URL }}\" >> local.properties
- name: Grant execute permission for gradlew
shell: bash
run: chmod +x gradlew

- name: Run Alpha Unit Tests
shell: bash
run: ./gradlew testAlphaUnitTest
229 changes: 0 additions & 229 deletions .github/workflows/Android_Develop_PR_Builder.yml

This file was deleted.

Loading

0 comments on commit 9b653e5

Please sign in to comment.