Repository navigation
78 lines (73 loc) · 2.75 KB
/
Copy pathci.yml
File metadata and controls
78 lines (73 loc) · 2.75 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
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
android:
name: Lint, test and build the Android library
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .nvmrc
cache: npm
- uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
with:
distribution: zulu
java-version: 21
- uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
- run: npm ci
- run: ./gradlew lint test assembleRelease --console=plain
publish:
needs: android
if: github.event_name == 'push'
permissions:
contents: write
uses: ./.github/workflows/publish.yml
with:
ref: ${{ github.sha }}
device:
name: Run the on-device tests on the API ${{ matrix.api-level }} ${{ matrix.arch }} emulator
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
include:
# 32-bit x86: bspatch's off_t is 32 bits there, so offtin()'s range check, OFF_MAX and the JNI cap run as shipped.
- api-level: 23
arch: x86
- api-level: 35
arch: x86_64
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .nvmrc
cache: npm
- uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
with:
distribution: zulu
java-version: 21
- uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
- name: Enable KVM for the emulator
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
- run: npm ci
- name: Run connectedDebugAndroidTest on the emulator
uses: reactivecircus/android-emulator-runner@a421e43855164a8197daf9d8d40fe71c6996bb0d # v2.38.0
with:
api-level: ${{ matrix.api-level }}
arch: ${{ matrix.arch }}
disable-animations: true
# A hosted runner's emulator can take past the action's ten-minute default to boot.
emulator-boot-timeout: 1200
emulator-options: -no-window -no-audio -no-boot-anim -gpu swiftshader_indirect -camera-back none
script: ./gradlew connectedDebugAndroidTest --console=plain