update Gradle wrapper to version 9.3.0 (#589) #80
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: "Android CI" | |
| on: | |
| push: | |
| paths-ignore: | |
| - '**/*.md' | |
| - '.github/workflows/codeql-analysis.yml' | |
| - '.github/workflows/close-empty-xml.yml' | |
| - '.github/workflows/stale.yml' | |
| - '.github/workflows/compare-src.yml' | |
| pull_request: | |
| paths-ignore: | |
| - '**/*.md' | |
| - '.github/workflows/codeql-analysis.yml' | |
| - '.github/workflows/close-empty-xml.yml' | |
| - '.github/workflows/stale.yml' | |
| - '.github/workflows/compare-src.yml' | |
| workflow_dispatch: {} | |
| jobs: | |
| ktlint: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/common-setup | |
| - name: ktlint check | |
| run: bash ./gradlew ktlintCheck --stacktrace | |
| - name: Upload ktlint report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ktlint-report | |
| path: app/build/reports/ktlint | |
| lint: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/common-setup | |
| - name: lint | |
| run: bash ./gradlew lintDebug --stacktrace | |
| - name: Upload lint report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lint-report | |
| path: app/build/reports/lint-results*.* | |
| test: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/common-setup | |
| - name: unit tests | |
| run: bash ./gradlew testDebugUnitTest --stacktrace | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results | |
| path: app/build/reports/tests | |
| coverage: | |
| runs-on: ubuntu-22.04 | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/common-setup | |
| - name: coverage | |
| run: bash ./gradlew jacocoTestCoverageVerification --stacktrace | |
| - name: Upload JaCoCo report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: jacoco-report | |
| path: app/build/reports/jacoco | |
| - name: upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| file: ./app/build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml | |
| build-apk: | |
| runs-on: ubuntu-22.04 | |
| needs: [ktlint, lint, test, coverage] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/common-setup | |
| - name: build apk | |
| run: bash ./gradlew assembleDebug --stacktrace | |
| - name: artifact apk | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: artifact-apk | |
| path: app/build/outputs/apk/debug | |
| emulator-test: | |
| runs-on: ubuntu-latest | |
| needs: [build-apk] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| api-level: [35] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/common-setup | |
| - name: Enable KVM | |
| 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: Gradle cache | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: AVD cache | |
| uses: actions/cache@v4 | |
| id: avd-cache | |
| with: | |
| path: | | |
| ~/.android/avd/* | |
| ~/.android/adb* | |
| key: avd-${{ matrix.api-level }} | |
| - name: Create AVD and generate snapshot for caching | |
| if: steps.avd-cache.outputs.cache-hit != 'true' | |
| uses: ./.github/actions/emulator-step | |
| with: | |
| api-level: ${{ matrix.api-level }} | |
| script: echo "Generated AVD snapshot for caching." | |
| - name: Build app and test APKs | |
| run: ./gradlew assembleDebug assembleDebugAndroidTest | |
| - name: Run instrumented tests | |
| uses: ./.github/actions/emulator-step | |
| with: | |
| api-level: ${{ matrix.api-level }} | |
| script: ./gradlew connectedDebugAndroidTest -x assembleDebug -x assembleDebugAndroidTest | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: emulator-test-results-${{ matrix.api-level }} | |
| path: app/build/reports/androidTests | |
| - name: Publish test results | |
| uses: mikepenz/action-junit-report@v5 | |
| if: always() | |
| with: | |
| report_paths: 'app/build/outputs/androidTest-results/connected/**/*.xml' | |