Github Actions 버전 업그레이드 (v3 to v4) (#377) #1359
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: CI | |
on: | |
pull_request: | |
branches: | |
- 'develop' | |
push: | |
branches: | |
- 'develop' | |
jobs: | |
cancel-workflow: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@0.6.0 | |
with: | |
access_token: ${{ github.token }} | |
static-check: | |
runs-on: ubuntu-latest | |
needs: cancel-workflow | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: 'adopt' | |
- name: Clean build | |
run: ./gradlew clean | |
- name: Run ktlintDebug | |
run: ./gradlew ktlintMainSourceSetCheck | |
- name: Upload ktlint report | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: ktlint-result | |
path: ./**/build/reports/ktlint/**/*.html | |
build: | |
runs-on: ubuntu-latest | |
needs: static-check | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: 'adopt' | |
- name: Clean build | |
run: ./gradlew clean | |
- name: Setup google-services.json (Staging) | |
run: | | |
mkdir -p ./app/src/staging | |
cat << EOF > ./app/src/staging/google-services.json | |
${{ secrets.google_services_json_staging }} | |
EOF | |
- name: Setup secrets.xml for app module (Staging) | |
run: | | |
mkdir -p ./app/src/staging/res/values | |
cat << EOF > ./app/src/staging/res/values/secrets.xml | |
${{ secrets.secrets_xml_staging }} | |
EOF | |
- name: Setup secrets.xml for core:network module (Staging) | |
run: | | |
mkdir -p ./core/network/src/staging/res/values | |
cat << EOF > ./core/network/src/staging/res/values/secrets.xml | |
${{ secrets.secrets_xml_staging_core_network }} | |
EOF | |
- name: Build debug APK | |
run: ./gradlew assembleStagingDebug --stacktrace |