-
Notifications
You must be signed in to change notification settings - Fork 4
129 lines (127 loc) · 4.1 KB
/
ci.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: CI
on:
pull_request:
workflow_dispatch:
jobs:
pre-commit:
name: Run pre-commit to check formatting and linting
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
with:
java: true
- uses: actions/setup-python@v5
with:
python-version: '3.12'
# pre-commit/action@v3.0.1
- run: python -m pip install pre-commit
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit
run: pre-commit run --show-diff-on-failure --color=always --all-files
test-android:
name: Test for Android
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
with:
java: true
kotlin-cache: true
rsvg: true
- run: ./gradlew spotlessCheck
- name: shared checks & unit tests
run: ./gradlew shared:check
env:
MAPBOX_SECRET_TOKEN: ${{ secrets.MAPBOX_SECRET_TOKEN }}
- uses: actions/upload-artifact@v4
if: failure()
with:
name: android-shared-reports
path: shared/build/reports
- name: android checks & unit tests
run: ./gradlew androidApp:check
env:
MAPBOX_SECRET_TOKEN: ${{ secrets.MAPBOX_SECRET_TOKEN }}
- uses: actions/upload-artifact@v4
if: failure()
with:
name: android-android-reports
path: androidApp/build/reports
emulator-test-android:
name: Run Android instrumented tests in emulator
runs-on: mobile_app_runner
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- api-level: 28
target: default
arch: x86
# - api-level: 33
# target: default
# arch: x86_64
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
with:
java: true
kotlin-cache: true
rsvg: true
# full setup including AVD snapshot caching from https://github.com/ReactiveCircus/android-emulator-runner/blob/a3dcdb348bb02349cd939d168a74e31a9094b7f0/README.md
- name: Enable KVM
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 tests
uses: reactivecircus/android-emulator-runner@v2
timeout-minutes: 30
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
force-avd-creation: false
disable-animations: true
script: ./bin/android-instrumented-test-ci.sh
env:
MAPBOX_SECRET_TOKEN: ${{ secrets.MAPBOX_SECRET_TOKEN }}
- uses: actions/upload-artifact@v4
if: failure()
with:
name: android-connected-reports-${{ matrix.api-level }}-${{ matrix.target }}-${{ matrix.arch }}
path: androidApp/build/reports
build-android:
name: Build for Android
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
with:
java: true
kotlin-cache: true
rsvg: true
ruby: true
- name: Build Android app
env:
FIREBASE_KEY: ${{ secrets.FIREBASE_KEY }}
GOOGLE_APP_ID_ANDROID: ${{ secrets.GOOGLE_APP_ID_ANDROID_STAGING }}
MAPBOX_SECRET_TOKEN: ${{ secrets.MAPBOX_SECRET_TOKEN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_DSN_ANDROID: ${{ secrets.SENTRY_DSN_ANDROID }}
SENTRY_ENVIRONMENT: "debug"
run: |
bundle exec fastlane android build flavor:Staging build_type:Debug