버전 코드 업 #39
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: Build and Test | |
| on: | |
| push: | |
| branches: [ main ] | |
| jobs: | |
| build: | |
| name: Test and Build Release APK | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| cache: gradle | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Cache Gradle packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Run all tests (113 tests) | |
| run: | | |
| set -o pipefail | |
| ./gradlew test --console=plain | tee test-output.log | |
| - name: Build Release APK | |
| run: ./gradlew assembleRelease --stacktrace --console=plain | |
| - name: Upload Release APK | |
| uses: actions/upload-artifact@v4 | |
| if: success() | |
| with: | |
| name: app-release | |
| path: app/build/outputs/apk/release/*.apk | |
| retention-days: 30 | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: test-results | |
| path: | | |
| **/build/test-results/**/*.xml | |
| **/build/reports/tests/** | |
| retention-days: 30 | |
| - name: Upload test log | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: test-log | |
| path: test-output.log | |
| retention-days: 30 | |
| - name: Test Summary | |
| uses: test-summary/action@v2 | |
| if: always() | |
| with: | |
| paths: "**/build/test-results/**/*.xml" | |
| sync-develop: | |
| name: Merge main into develop | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Merge main into develop | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git fetch origin main develop | |
| git checkout -B develop origin/develop | |
| git merge --no-ff --no-edit origin/main | |
| git push origin develop |