blob: 157ec29b8b6c77a98e62d7e1b3e15f643e942286 (
plain)
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
version: 2.1
jobs:
build:
parameters:
build-steps:
description: "Steps that will be executed for this build"
type: steps
default: []
docker:
- image: circleci/android:api-30
working_directory: ~/AntennaPod
environment:
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx1536m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError"'
_JAVA_OPTIONS: "-Xms256m -Xmx1280m"
steps:
- checkout
- restore_cache:
keys:
- v1-android-{{ checksum "build.gradle" }}
- v1-android-
- run:
name: Create temporary release keystore
command: keytool -noprompt -genkey -v -keystore "app/keystore" -alias alias -storepass password -keypass password -keyalg RSA -validity 10 -dname "CN=antennapod.org, OU=dummy, O=dummy, L=dummy, S=dummy, C=US"
- steps: << parameters.build-steps >>
- save_cache:
paths:
- ~/.android
- ~/.gradle
- ~/android
key: v1-android-{{ checksum "build.gradle" }}
workflows:
unit-tests:
jobs:
- build:
name: Build debug
build-steps:
- run:
name: Build debug
command: ./gradlew assembleDebug -PdisablePreDex
- store_artifacts:
name: Uploading apk artifact
path: app/build/outputs/apk/play/debug/app-play-debug.apk
destination: app-play-debug.apk
- run:
name: Execute debug unit tests
command: ./gradlew testPlayDebugUnitTest -PdisablePreDex
- build:
name: Build release
build-steps:
- run:
name: Build release
command: ./gradlew assembleRelease -PdisablePreDex
- run:
name: Execute release unit tests
command: ./gradlew testPlayReleaseUnitTest -PdisablePreDex
- build:
name: Build integration tests
build-steps:
- run:
name: Build integration tests
command: ./gradlew assemblePlayDebugAndroidTest -PdisablePreDex
- build:
name: Build free
build-steps:
- run:
name: Build free (for F-Droid)
command: ./gradlew assembleFreeRelease -PdisablePreDex
static-analysis:
jobs:
- build:
name: Checkstyle
build-steps:
- run:
name: Checkstyle
command: ./gradlew checkstyle
- run:
name: Diff-Checkstyle
command: |
git fetch origin develop
branchBaseCommit=`git merge-base origin/develop HEAD`
echo "Comparing to $branchBaseCommit"
curl -s -L https://github.com/yangziwen/diff-checkstyle/releases/download/0.0.4/diff-checkstyle.jar > diff-checkstyle.jar
java -Dconfig_loc=config/checkstyle -jar diff-checkstyle.jar -c config/checkstyle/checkstyle-new-code.xml --git-dir . --base-rev $branchBaseCommit
- build:
name: Lint
build-steps:
- run:
name: Lint
command: ./gradlew lintPlayRelease lintRelease
- build:
name: SpotBugs
build-steps:
- run:
name: SpotBugs
command: ./gradlew spotbugsPlayDebug spotbugsDebug 2>&1 | grep -i "spotbugs"
- build:
name: XML
build-steps:
- run:
name: XML of changed files
command: |
git fetch origin develop
branchBaseCommit=`git merge-base origin/develop HEAD`
echo "Comparing to $branchBaseCommit"
curl -s -L https://github.com/ByteHamster/android-xml-formatter/releases/download/1.1.0/android-xml-formatter.jar > android-xml-formatter.jar
git diff --name-only $branchBaseCommit --diff-filter=AM | { grep "res/layout/" || true; } | xargs java -jar android-xml-formatter.jar
test $(git diff | wc -l) -eq 0 || (echo -e "\n\n===== Found XML code style violations! See output below how to fix them. =====\n\n" && git --no-pager diff --color=always && false)
|