Update dependency jacoco to v0.8.10 #341
Workflow file for this run
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: Gradle Build | |
on: [push] | |
jobs: | |
build: | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
clean: true | |
# not needed because using a self-hosted runner with jdk and android already on it: | |
# https://github.com/compscidr/docker-github-actions-runner-android | |
# - name: Set up JDK | |
# uses: actions/setup-java@v3 | |
# with: | |
# java-version: 11 | |
# distribution: temurin | |
# - name: Setup Android SDK | |
# uses: android-actions/setup-android@v2 | |
- name: Build with Gradle | |
run: ./gradlew clean build --no-build-cache | |
- name: lint | |
run: ./gradlew app:lint | |
- name: lint results | |
uses: yutailang0119/action-android-lint@v3.1.0 | |
with: | |
report-path: app/build/reports/lint/report.xml | |
- name: Jvm Unit Tests with Coverage Report | |
run: ./gradlew jacocoTestReportDebug | |
- name: On-Device Instrumented Tests with CoverageReport | |
run: | | |
timeout 10 adb wait-for-device && | |
adb uninstall --user 0 com.example.myapplication || true && | |
adb uninstall --user 0 com.example.myapplication.test || true && | |
./gradlew coverageReport | |
- uses: actions/upload-artifact@v3 | |
name: Store Reporting Artifacts | |
if: failure() | |
with: | |
name: app-reports | |
path: | | |
app/build/reports | |
app/build/outputs | |
- name: cleanup adb | |
if: always() | |
run: adb kill-server | |
- name: Upload Unit Tests Report to CodeCov | |
# https://github.com/codecov/codecov-action | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
flags: unittests | |
files: ./app/build/reports/jacoco/jacocoTestReportDebug/jacocoTestReportDebug.xml | |
- name: Upload Instrumented Tests Report to CodeCov | |
# https://github.com/codecov/codecov-action | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
flags: instrumentedtests | |
files: ./app/build/reports/jacoco.xml | |
- name: Export environment variables | |
run: | | |
echo "VERSION_NAME=$(cat app/build/outputs/app_versioning/release/version_name.txt)" >> $GITHUB_ENV | |
echo "VERSION_CODE=$(cat app/build/outputs/app_versioning/release/version_code.txt)" >> $GITHUB_ENV | |
- name: Build and Publish Release | |
env: | |
GH_USER: ${{ secrets.GH_USER }} | |
GH_PAT: ${{ secrets.GH_PAT }} | |
run: ./gradlew assemble bundle publishAllPublicationsToGithubPackagesRepository | |
# https://github.com/actions/checkout/issues/715 | |
# https://github.com/actions/checkout/pull/579 | |
- name: clean local tags | |
if: always() | |
run: | | |
cd /tmp/hello-kotlin-android/hello-kotlin-android/hello-kotlin-android && | |
git config --global --add safe.directory /tmp/hello-kotlin-android/hello-kotlin-android/hello-kotlin-android && | |
git tag -d $(git tag -l) |