forked from AdAway/AdAway
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (48 loc) · 1.77 KB
/
android-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "build-tools;34.0.0" --sdk_root=${ANDROID_SDK_ROOT}
- name: Install NDK
run: echo "y" | sudo ${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