-
-
Notifications
You must be signed in to change notification settings - Fork 28
102 lines (99 loc) · 3.71 KB
/
commcare-android-pr-workflow.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
name: commcare-android PR CI
env:
PR_NUM: ${{github.event.issue.number || github.event.number }}
on:
pull_request:
types: [opened, edited]
issue_comment:
jobs:
build-test-assemble:
if: ${{ github.event_name == 'pull_request' || (github.event_name == 'issue_comment' && contains(github.event.comment.body, 'retest this please'))}}
name: Build
runs-on: macos-latest
steps:
- name: Checkout commcare-android
uses: actions/checkout@v3
with:
ref: refs/pull/${{env.PR_NUM}}/head
- name: Install python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Download cross request script
run: |
curl https://raw.githubusercontent.com/dimagi/mobile-deploy/master/requirements.txt -o requirements.txt
curl https://raw.githubusercontent.com/dimagi/mobile-deploy/master/checkout_cross_request_repo.py -o checkout_cross_request_repo.py
- name: Install Python dependencies
uses: py-actions/py-dependency-install@v4
with:
path: "requirements.txt"
- name: List python
run: |
pip list
- name: Run cross request script
run: |
python3 checkout_cross_request_repo.py commcare-android ${{env.PR_NUM}} commcare-core
- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Clean with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: clean
- name: Run Linters
uses: gradle/gradle-build-action@v2
with:
arguments: lintCommcareRelease
- name: Run Tests
uses: gradle/gradle-build-action@v2
with:
arguments: testCommcareDebug
- name: Assemble Debug apk
uses: gradle/gradle-build-action@v2
with:
arguments: assembleCommcareDebug
- name: Restore Keystore
run: echo $SIGNING_KEY | base64 -d > ˜/.gradle/commcare-odk-keys.keystore
- name: Assemble Release apk
uses: gradle/gradle-build-action@v2
with:
arguments: assembleCommcareRelease
env:
RELEASE_KEY_ALIAS: ${{ secrets.ALIAS }}
RELEASE_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
RELEASE_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
RELEASE_STORE_FILE: "˜/.gradle/commcare-odk-keys.keystore"
- name: Upload CommCare apk
uses: actions/upload-artifact@v3
with:
name: commcare-arelease-pk
path: commcare-android/app/build/outputs/apk/commcare/release/app-commcare-release.apk
- name: Assemble LTS apk
uses: gradle/gradle-build-action@v2
with:
arguments: assembleLtsRelease
- name: Upload CommCare LTS apk
uses: actions/upload-artifact@v3
with:
name: app-lts-release
path: commcare-android/app/build/outputs/apk/lts/release/app-lts-release.apk
- name: CommCare apk for Instrumentation Testing
uses: gradle/gradle-build-action@v2
with:
arguments: assembleCommcareReleaseAndroidTest
- name: Upload CommCare apk for Instrumentation Testing
uses: actions/upload-artifact@v3
with:
name: commcare-release-androidTest-apk
path: commcare-android/app/build/outputs/apk/androidTest/commcare/release/app-commcare-release-androidTest.apk
- name: CommCare apk for Instrumentation Testing
uses: gradle/gradle-build-action@v2
with:
arguments: JacocoTestReport
- name: Upload JaCoCo Report
uses: actions/upload-artifact@v3
with:
name: jacoco-report
path: commcare-android/app/build/reports