WIP: try to fix CI setup #1272
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 | |
# Manually install latest build tools (takes up to two weeks to update in action images) | |
- name: Install latest build tools | |
run: echo "y" | ${ANDROID_HOME}/tools/bin/sdkmanager --install "build-tools;34.0.0" --sdk_root=${ANDROID_SDK_ROOT} | |
- name: Install NDK | |
run: echo "y" | ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;25.2.9519653" --sdk_root=${ANDROID_SDK_ROOT} | |
- 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] | |
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 |