Skip to content

update agp

update agp #344

Workflow file for this run

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: Clean Packages
run: bash ./scripts/clean-packages.sh
- name: On-Device Instrumented Tests with CoverageReport
run: ./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)