-
Notifications
You must be signed in to change notification settings - Fork 28
108 lines (88 loc) · 2.98 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
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
name: Network Survey CI
on:
pull_request:
branches:
- 'develop'
push:
branches:
- 'develop'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
if: "! startsWith(github.event.head_commit.message, 'Bump version to')"
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
cache: 'gradle'
- name: Build CDR APK
env:
NS_API_KEY: ${{ secrets.NS_API_KEY }}
run: ./gradlew assembleCdrDebug
-PnsApiKey=$NS_API_KEY
- name: Get APK name
run: echo "base_name=`./gradlew :networksurvey:properties -q | grep 'archivesBaseName:' | awk '{print $2}'`" >> $GITHUB_ENV
- name: Upload CDR APK
uses: actions/upload-artifact@v4
with:
name: Network Survey CDR Debug APK
path: networksurvey/build/outputs/apk/cdr/debug/${{ env.base_name }}-cdr-debug.apk
- name: Save google-services.json
env:
GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES }}
run: echo "$GOOGLE_SERVICES" > networksurvey/google-services.json
- name: Build Regular APK
env:
NS_API_KEY: ${{ secrets.NS_API_KEY }}
run: ./gradlew assembleRegularDebug
-PnsApiKey=$NS_API_KEY
- name: Upload Regular APK
uses: actions/upload-artifact@v4
with:
name: Network Survey Regular Debug APK
path: networksurvey/build/outputs/apk/regular/debug/${{ env.base_name }}-regular-debug.apk
test:
if: "! startsWith(github.event.head_commit.message, 'Bump version to')"
name: Run Tests
runs-on: macos-latest
strategy:
matrix:
api-level: [ 26, 35 ]
target: [ default, google_apis ]
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
cache: 'gradle'
- name: Save google-services.json
env:
GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES }}
run: echo "$GOOGLE_SERVICES" > networksurvey/google-services.json
- name: Unit Tests
run: ./gradlew test --stacktrace
# Need to work through a permissions error to get these working
# - name: Instrumentation Tests
# uses: reactivecircus/android-emulator-runner@v2
# with:
# api-level: ${{ matrix.api-level }}
# target: ${{ matrix.target }}
# arch: x86_64
# profile: Nexus 6
# script: ./gradlew test check connectedCheck -x lint --stacktrace
# Only upload the reports on failure
- name: Upload Reports
uses: actions/upload-artifact@v4
with:
name: Test-Reports
path: networksurvey/build/reports
if: failure()