-
Notifications
You must be signed in to change notification settings - Fork 1
118 lines (95 loc) · 3 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
name: Build and run local tests
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
env:
RAWG_API_KEY: ${{ secrets.RAWG_API_KEY }}
BUGSNAG_API_KEY: ${{ secrets.BUGSNAG_API_KEY }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Setup Gradle
uses: gradle/gradle-build-action@v2.7.0
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build debug
run: ./gradlew assembleDebug packageDistributionForCurrentOS --stacktrace
- name: Run local tests
run: ./gradlew testDebug desktopTest --stacktrace
- name: Apply ktlint formatting to (.kt/s) files.
run: ./gradlew ktlintFormat --stacktrace
- name: Apply Spotless formatting if not applied.
run: ./gradlew spotlessApply --stacktrace
- name: Commit and push changes (if any).
uses: EndBug/add-and-commit@v9
with:
author_name: GitHub Actions
author_email: github-actions@github.com
message: Apply style formatting
push: true
- name: Upload build outputs (APKs & Desktop binaries)
uses: actions/upload-artifact@v3
with:
name: build-outputs
path: |
**/build/outputs/*
**/build/compose/*
- name: Upload build reports
if: always()
uses: actions/upload-artifact@v3
with:
name: build-reports
path: ./**/build/reports
androidTest:
runs-on: macos-latest # enables hardware acceleration in the virtual machine
needs: build
timeout-minutes: 30
strategy:
matrix:
api-level: [ 29, 30, 31, 33 ]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'zulu'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2.7.0
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Run instrumentation tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
target: google_apis
disable-animations: true
disk-size: 6000M
heap-size: 600M
script: ./gradlew connectedDebugAndroidTest --stacktrace --daemon
- name: Upload test reports
if: always()
uses: actions/upload-artifact@v3
with:
name: test-reports-${{ matrix.api-level }}
path: ./**/build/reports