fix(ci): Fix github actions to build android app #1274
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: Android CI | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
name: Development build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
cache: 'gradle' | |
- name: Restore SonarCloud packages cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.sonar/cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: Run unit tests | |
run: ./gradlew test --stacktrace | |
- name: Build with Gradle | |
run: ./gradlew assembleRelease --stacktrace | |
# - name: Upload APK | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: AdAway-dev | |
# path: app/build/outputs/apk/release/app-release-unsigned.apk | |
- name: Update dependency graph | |
uses: mikepenz/[email protected] # Deprecated: need to be changed | |
with: | |
gradle-dependency-path: "app/build.gradle" | |
gradle-build-module: ":app" | |
gradle-build-configuration: "releaseCompileClasspath" | |
- name: Analyze project | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: ./gradlew -Dorg.gradle.jvmargs=-XX:MaxMetaspaceSize=512m sonarqube |