forked from FlowCI/templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathandroid.yaml
82 lines (67 loc) · 1.84 KB
/
android.yaml
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#
# Android Project Template with Gradle
#
envs:
FLOWCI_GIT_URL: "https://github.com/hidroh/materialistic.git"
GRADLE_USER_HOME: "${FLOWCI_AGENT_WORKSPACE}/.gradle"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
docker:
image: openjdk:11-jdk
steps:
- name: setup android sdk
envs:
ANDROID_COMPILE_SDK: "28"
ANDROID_BUILD_TOOLS: "28.0.2"
plugin: android-sdk-setup
- name: clone
docker:
image: flowci/debian-git
plugin: 'gitclone'
- name: lint
bash: |
cd ${FLOWCI_GIT_REPO}
./gradlew -Pci --console=plain :app:lintDebug -PbuildDir=lint
- name: build
bash: |
cd ${FLOWCI_GIT_REPO}
./gradlew assembleDebug
- name: test
timeout: 7200
bash: |
cd ${FLOWCI_GIT_REPO}
./gradlew -Pci --console=plain :app:testDebug
- name: jacoco
bash: |
cd ${FLOWCI_GIT_REPO}
mkdir -p ${PWD}/app/build/intermediates/classes
ln -s ${PWD}/app/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes ${PWD}/app/build/intermediates/classes/debug
./gradlew -Pci --console=plain jacocoTestReport
- name: upload report
docker:
image: ubuntu:18.04
envs:
# report from jacoco
REPORT_PATH: ${FLOWCI_GIT_REPO}/app/build/reports/coverage
REPORT_NAME: Code Coverage
plugin: report-upload
- name: build release
bash: |
cd ${FLOWCI_GIT_REPO}
./gradlew assembleRelease
###############################################
### to sign apk, it needs to create a 'secret' in admin page,
### and put the secret name to `SIGN_SECRET`
###############################################
# - name: sign apk
# envs:
# SIGN_FILE_PATTERN: '*-unsigned.apk'
# SIGN_SECRET: android-demo
# docker:
# image: openjdk:8-jdk
# plugin: android-signing
# - name: upload singed apk
# docker:
# image: ubuntu:18.04
# envs:
# artifact_pattern: '*-signed.apk'
# plugin: 'artifact-upload'