-
Notifications
You must be signed in to change notification settings - Fork 13
147 lines (139 loc) · 4.24 KB
/
pull-request-app-checks.yml
File metadata and controls
147 lines (139 loc) · 4.24 KB
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
name: "Android Sample App Checks"
on:
workflow_call:
inputs:
app_relative_path:
description: 'repo path for sample app'
required: true
type: string
jobs:
confirm-folder-changes:
name: "Confirm changes in sample app folder"
runs-on: ubuntu-latest
steps:
- name: "Checkout Sample Apps"
uses: actions/checkout@v4
with:
submodules: recursive
# - name: "Create Path Triggers"
# uses: dorny/paths-filter@v2
# id: changes
# with:
# base: main
# ref: ${{ github.head_ref }}
# filters: |
# sample-app:
# - '${{ inputs.app_relative_path }}/**'
# - name: "Cancel workflow"
# if: steps.changes.outputs.sample-app != 'true'
# uses: andymckay/cancel-action@0.2
instrumented-tests:
name: "Instrumented Tests"
timeout-minutes: 30
runs-on: ubuntu-latest
needs: confirm-folder-changes
steps:
- name: "Checkout Branch"
uses: actions/checkout@v4
with:
submodules: recursive
- name: "Install JDK"
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: 17
cache: "gradle"
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: "Run Instrumented Tests"
uses: reactivecircus/android-emulator-runner@v2
with:
working-directory: ${{ inputs.app_relative_path }}
api-level: 29
arch: x86_64
profile: Nexus 6
script: ./gradlew connectedCheck
- name: "Archive Instrumented Tests Results"
uses: actions/upload-artifact@v5
if: ${{ always() }}
with:
name: "instrumented-tests-results"
path: ./**/build/reports/androidTests/connected/**
unit-tests:
name: "Unit Tests"
timeout-minutes: 15
runs-on: ubuntu-latest
needs: confirm-folder-changes
steps:
- name: "Checkout Branch"
uses: actions/checkout@v4
with:
submodules: recursive
- name: "Install JDK"
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: 17
cache: "gradle"
- name: "Run Unit Tests"
working-directory: ${{ inputs.app_relative_path }}
run: ./gradlew test
- name: "Android Unit Tests Report"
uses: actions/upload-artifact@v5
if: ${{ always() }}
with:
name: "unit-tests-results"
path: ./**/build/reports/**
lint-checks:
name: "Lint Checks"
timeout-minutes: 15
runs-on: ubuntu-latest
needs: confirm-folder-changes
steps:
- name: "Checkout Branch"
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install JDK
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: 17
cache: "gradle"
- name: "Run Android Core SDK Lint"
working-directory: ${{ inputs.app_relative_path }}
run: ./gradlew lint
- name: "Archive Lint Test Results"
uses: actions/upload-artifact@v5
if: ${{ always() }}
with:
name: "lint-results"
path: ./**/build/reports/**
kotlin-lint-checks:
name: "Kotlin Lint Checks"
timeout-minutes: 15
runs-on: ubuntu-latest
needs: confirm-folder-changes
steps:
- name: "Checkout Branch"
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install JDK
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: 17
cache: "gradle"
- name: "Run Android Core SDK Kotlin Lint"
working-directory: ${{ inputs.app_relative_path }}
run: ./gradlew ktlintCheck
- name: "Archive Lint Test Results"
uses: actions/upload-artifact@v5
if: ${{ always() }}
with:
name: "kotlin-lint-results"
path: ./**/build/reports/**