-
Notifications
You must be signed in to change notification settings - Fork 1
166 lines (135 loc) · 5.7 KB
/
main.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: Main Branch CI/CD
on:
push:
branches:
- 'main'
jobs:
test:
runs-on: ubuntu-latest
env:
CCDROIDX_RELEASE_KEYSTORE_PASSWORD: ${{ secrets.CCDROIDX_RELEASE_KEYSTORE_PASSWORD }}
CCDROIDX_RELEASE_KEY_ALIAS: ${{ secrets.CCDROIDX_RELEASE_KEY_ALIAS }}
CCDROIDX_RELEASE_KEY_ALIAS_PASSWORD: ${{ secrets.CCDROIDX_RELEASE_KEY_ALIAS_PASSWORD }}
CCDROIDX_RELEASE_KEYSTORE_PATH: release.keystore
GOOGLE_SERVICE_JSON: ${{ secrets.GOOGLE_SERVICE_JSON }}
steps:
- uses: actions/checkout@v3
- name: Stub release keystore file
run: |
touch release.keystore
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Decrypt google service json
run: |
TMP_GOOGLE_SERVICE_JSON_DIR="${RUNNER_TEMP}"/play
mkdir "${TMP_GOOGLE_SERVICE_JSON_DIR}"
echo $GOOGLE_SERVICE_JSON | base64 -di > "${TMP_GOOGLE_SERVICE_JSON_DIR}"/google-services.json
mv "${TMP_GOOGLE_SERVICE_JSON_DIR}"/google-services.json app/google-services.json
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Set up Gradle
uses: gradle/gradle-build-action@v2
- name: Lint check
run: ./gradlew lint
- name: Upload lint reports
uses: actions/upload-artifact@v3
with:
name: lint-reports
path: '**/build/reports/lint-results-*.html'
- name: Unit Test
run: ./gradlew testFlossDebugUnitTest testFullDebugUnitTest testDebugUnitTest
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: test-results-unit
path: '**/build/reports/tests/test*UnitTest'
androidTest:
runs-on: macos-latest
env:
CCDROIDX_RELEASE_KEYSTORE_PASSWORD: ${{ secrets.CCDROIDX_RELEASE_KEYSTORE_PASSWORD }}
CCDROIDX_RELEASE_KEY_ALIAS: ${{ secrets.CCDROIDX_RELEASE_KEY_ALIAS }}
CCDROIDX_RELEASE_KEY_ALIAS_PASSWORD: ${{ secrets.CCDROIDX_RELEASE_KEY_ALIAS_PASSWORD }}
CCDROIDX_RELEASE_KEYSTORE_PATH: release.keystore
GOOGLE_SERVICE_JSON: ${{ secrets.GOOGLE_SERVICE_JSON }}
timeout-minutes: 90
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Stub release keystore file
run: |
touch release.keystore
- name: Decrypt google service json
run: |
TMP_GOOGLE_SERVICE_JSON_DIR="${RUNNER_TEMP}"/play
mkdir "${TMP_GOOGLE_SERVICE_JSON_DIR}"
echo $GOOGLE_SERVICE_JSON | base64 -D > "${TMP_GOOGLE_SERVICE_JSON_DIR}"/google-services.json
mv "${TMP_GOOGLE_SERVICE_JSON_DIR}"/google-services.json app/google-services.json
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Accept Android licenses
run: yes | "$ANDROID_HOME"/cmdline-tools/latest/bin/sdkmanager --licenses || true
- name: Set up Gradle
uses: gradle/gradle-build-action@v2
- name: Build AndroidTest apps
run: ./gradlew packageFlossDebug packageFlossDebugAndroidTest packageFullDebug packageFullDebugAndroidTest
- name: Run Android Test
run: ./gradlew testDevicesGroupFlossDebugAndroidTest --no-parallel --max-workers=1
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" -Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true
- name: Upload Android test reports
uses: actions/upload-artifact@v3
with:
name: test-reports-GMD
path: '**/build/reports/androidTests/managedDevice/debug/flavors'
screenshotTest:
runs-on: macos-latest
env:
CCDROIDX_RELEASE_KEYSTORE_PASSWORD: ${{ secrets.CCDROIDX_RELEASE_KEYSTORE_PASSWORD }}
CCDROIDX_RELEASE_KEY_ALIAS: ${{ secrets.CCDROIDX_RELEASE_KEY_ALIAS }}
CCDROIDX_RELEASE_KEY_ALIAS_PASSWORD: ${{ secrets.CCDROIDX_RELEASE_KEY_ALIAS_PASSWORD }}
CCDROIDX_RELEASE_KEYSTORE_PATH: release.keystore
GOOGLE_SERVICE_JSON: ${{ secrets.GOOGLE_SERVICE_JSON }}
timeout-minutes: 90
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Stub release keystore file
run: |
touch release.keystore
- name: Decrypt google service json
run: |
TMP_GOOGLE_SERVICE_JSON_DIR="${RUNNER_TEMP}"/play
mkdir "${TMP_GOOGLE_SERVICE_JSON_DIR}"
echo $GOOGLE_SERVICE_JSON | base64 -D > "${TMP_GOOGLE_SERVICE_JSON_DIR}"/google-services.json
mv "${TMP_GOOGLE_SERVICE_JSON_DIR}"/google-services.json app/google-services.json
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Accept Android licenses
run: yes | "$ANDROID_HOME"/cmdline-tools/latest/bin/sdkmanager --licenses || true
- name: Set up Gradle
uses: gradle/gradle-build-action@v2
- name: Verify Screenshot
id: verifyScreenshot
run: ./gradlew app:verifyRoborazziFlossDebug
- name: Compare Screenshot
id: compare-screenshot
if: always() && (steps.verifyScreenshot.outcome == 'failure')
run: ./gradlew app:compareRoborazziFlossDebug
- name: Upload Android test reports
if: always() && (steps.verifyScreenshot.outcome == 'failure')
uses: actions/upload-artifact@v3
with:
name: test-reports-screenshot
path: '**/build/outputs/roborazzi'