-
Notifications
You must be signed in to change notification settings - Fork 29
131 lines (107 loc) · 4.49 KB
/
build.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
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Build and Test
on:
push:
branches:
- master
pull_request:
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@216d1ad2b3710bf005dc39237337b9673fd8fcd5 # v3.3.2
- name: Configure JDK
uses: actions/setup-java@d202f5dbf7256730fb690ec59f6381650114feb2 # v1.4.3
with:
java-version: 11
- run: touch local.properties
- name: Lint Check
run: ./gradlew :iterableapi:lintDebug
- name: Checkstyle
run: ./gradlew :iterableapi:checkstyle :iterableapi-ui:assembleDebug
- name: Javadoc Check
run: ./gradlew :iterableapi:javadoc :iterableapi-ui:javadoc
unit-tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@216d1ad2b3710bf005dc39237337b9673fd8fcd5 # v3.3.2
- name: Configure JDK
uses: actions/setup-java@d202f5dbf7256730fb690ec59f6381650114feb2 # v1.4.3
with:
java-version: 11
- run: touch local.properties
- name: Test
run: ./gradlew :iterableapi:jacocoTestDebugUnitTestReport :app:jacocoDebugTestReport
- name: Upload coverage data
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: unit-tests
path: |
./**/build/**/jacoco*.xml
./**/build/**/report.xml
instrumentation-tests:
name: Instrumentation tests
runs-on: macos-13
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@216d1ad2b3710bf005dc39237337b9673fd8fcd5 # v3.3.2
- name: Configure JDK
uses: actions/setup-java@d202f5dbf7256730fb690ec59f6381650114feb2 # v1.4.3
with:
java-version: 17
- run: touch local.properties
- name: Test
uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # v2.30.1
with:
api-level: 28
script: ./gradlew :iterableapi:connectedCheck :app:jacocoDebugAndroidTestReport
- name: Upload coverage data
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: instrumentation-tests
path: |
./**/build/**/jacoco*.xml
./**/build/**/report.xml
report-coverage:
name: Report coverage
runs-on: ubuntu-latest
needs: [unit-tests, instrumentation-tests]
env:
JACOCO_SOURCE_PATH: "iterableapi/src/main/java iterableapi-ui/src/main/java"
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Configure JDK
uses: actions/setup-java@d202f5dbf7256730fb690ec59f6381650114feb2 # v1.4.3
with:
java-version: 11
- run: curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- run: chmod +x ./cc-test-reporter
- run: ./cc-test-reporter before-build
- name: Download unit tests coverage
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: unit-tests
- name: Download instrumentation tests coverage
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: instrumentation-tests
- run: bash <(curl -s https://codecov.io/bash)
- run: ./cc-test-reporter format-coverage app/build/reports/jacoco/jacocoDebugTestReport/jacocoDebugTestReport.xml --input-type jacoco -d
- run: ./cc-test-reporter format-coverage iterableapi/build/reports/coverage/androidTest/debug/connected/report.xml --input-type jacoco -d
- run: ./cc-test-reporter format-coverage iterableapi/build/jacoco/jacoco.xml --input-type jacoco -d
- run: ./cc-test-reporter format-coverage app/build/reports/jacoco/jacocoDebugAndroidTestReport/jacocoDebugAndroidTestReport.xml --input-type jacoco -d
- run: ./cc-test-reporter upload-coverage
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}