chore(deps): update jacoco to 0.8.14 (#33) #91
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: CI | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| tags: | |
| - 'v*' # Trigger on version tags like v1.0.0 | |
| pull_request: | |
| branches: [ main, develop ] | |
| permissions: | |
| contents: write # Required for creating releases and uploading assets | |
| actions: read # Required for accessing workflow artifacts | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - 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: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Run unit tests | |
| run: ./gradlew test --continue | |
| - name: Generate unit test coverage report | |
| run: ./gradlew jacocoTestReport | |
| - name: Run lint | |
| run: ./gradlew lint | |
| - name: Build debug APK | |
| run: ./gradlew assembleDebug | |
| - name: Enable KVM group perms | |
| run: | | |
| echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
| sudo udevadm control --reload-rules | |
| sudo udevadm trigger --name-match=kvm | |
| - name: Set up Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: AVD cache | |
| uses: actions/cache@v4 | |
| id: avd-cache | |
| with: | |
| path: | | |
| ~/.android/avd/* | |
| ~/.android/adb* | |
| key: avd-29-default-x86_64 | |
| - name: Create AVD and generate snapshot for caching | |
| if: steps.avd-cache.outputs.cache-hit != 'true' | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: 29 | |
| target: default | |
| arch: x86_64 | |
| force-avd-creation: false | |
| emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -memory 2048 -no-snapshot-load | |
| disable-animations: true | |
| script: | | |
| echo "Generated AVD snapshot for caching." | |
| adb shell input keyevent 82 | |
| - name: Run instrumented tests and generate coverage | |
| timeout-minutes: 30 | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: 29 | |
| target: default | |
| arch: x86_64 | |
| force-avd-creation: false | |
| emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -memory 2048 | |
| disable-animations: true | |
| script: | | |
| ./gradlew connectedAndroidTest | |
| ./gradlew createDebugCoverageReport | |
| - name: Generate full coverage report (unit + instrumented) | |
| run: ./gradlew jacocoFullReport | |
| - name: Force cleanup emulator processes | |
| if: always() | |
| run: | | |
| pkill -f emulator || true | |
| pkill -f qemu || true | |
| - name: Upload full coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./app/build/reports/jacoco/jacocoFullReport/jacocoFullReport.xml | |
| flags: full-coverage | |
| name: codecov-full | |
| fail_ci_if_error: false | |
| verbose: true | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: test-results | |
| path: | | |
| app/build/reports/tests/ | |
| app/build/reports/androidTests/ | |
| retention-days: 30 | |
| - name: Upload lint results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: lint-results | |
| path: app/build/reports/lint-results-debug.html | |
| retention-days: 30 | |
| # Tag-triggered release job | |
| release: | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| needs: test | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - 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: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Build debug APK for release | |
| run: ./gradlew assembleDebug | |
| - name: Get tag name | |
| id: tag | |
| run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| app/build/outputs/apk/debug/app-debug.apk | |
| name: Release ${{ steps.tag.outputs.tag }} | |
| body: | | |
| Release ${{ steps.tag.outputs.tag }} | |
| ## Installation | |
| Download and install the `app-debug.apk` file below. | |
| **Note**: This is a debug-signed APK for easy installation. Enable "Install unknown apps" for your browser/file manager if needed. | |
| ## What's Changed | |
| - See commit history for detailed changes | |
| draft: false | |
| prerelease: ${{ contains(steps.tag.outputs.tag, 'beta') || contains(steps.tag.outputs.tag, 'alpha') || contains(steps.tag.outputs.tag, 'rc') }} | |
| generate_release_notes: true |