-
Notifications
You must be signed in to change notification settings - Fork 189
132 lines (112 loc) · 3.44 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
132
name: Build
# From now in android
# https://github.com/android/nowinandroid
on:
push:
branches:
- main
pull_request:
paths-ignore:
- 'app-ios/**'
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
jobs:
get-pr-number:
if: github.event_name == 'pull_request'
name: "get-pr-number"
runs-on: ubuntu-latest
steps:
- name: ${{ github.event.pull_request.number }}
run: echo ok
build:
runs-on: macos-12
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.konan
key: ${{ runner.os }}-kotlin-native-${{ hashFiles('gradle/libs.versions.toml', '**/*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-kotlin-native-
- name: Validate Gradle Wrapper
uses: gradle/[email protected]
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Check spotless
run: ./gradlew spotlessCheck --stacktrace
- name: Check ComposeLint
run: ./gradlew composeLint --stacktrace
- name: Check lint
run: ./gradlew lintDebug --stacktrace
# continue-on-error: true # https://issuetracker.google.com/issues/241787635
- name: Build all build type and flavor permutations
run: ./gradlew assemble --stacktrace
- name: Build zipline
run: ./gradlew compileZipline --stacktrace
- name: Run local tests
run: ./gradlew testDebug --stacktrace
- name: Upload build outputs (APKs)
uses: actions/upload-artifact@v3
with:
name: assemble-output
path: app-android/build/outputs/apk/dev/debug/app-android-dev-debug.apk
retention-days: 14
- name: Upload build reports
if: always()
uses: actions/upload-artifact@v3
with:
name: build-reports
path: app-android/build/reports
retention-days: 30
# save computation resource for now
# androidTest:
# needs: build
# runs-on: macOS-latest # enables hardware acceleration in the virtual machine
# timeout-minutes: 45
# strategy:
# matrix:
# api-level: [ 23, 26, 30 ]
#
# steps:
# - name: Checkout
# uses: actions/checkout@v3
#
# - name: Copy CI gradle.properties
# run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
#
# - name: Set up JDK 11
# uses: actions/setup-java@v3
# with:
# java-version: 11
# distribution: 'temurin'
#
# - name: Setup Gradle
# uses: gradle/gradle-build-action@v2
#
# - name: Run instrumentation tests
# uses: reactivecircus/android-emulator-runner@v2
# with:
# api-level: ${{ matrix.api-level }}
# arch: x86_64
# disable-animations: true
# disk-size: 1500M
# heap-size: 512M
# script: ./gradlew connectedDebugAndroidTest
#
# - name: Upload test reports
# if: always()
# uses: actions/upload-artifact@v3
# with:
# name: test-reports
# path: '*/build/reports/androidTests'