-
Notifications
You must be signed in to change notification settings - Fork 4
73 lines (64 loc) · 1.99 KB
/
build-test.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
name: Build-and-Test
run-name: Build and Test on ${{ github.sha }}
on:
push:
branches:
- master
paths:
- 'app/**'
- 'settings.gradle'
- 'build.gradle'
- '.github/workflows/build-test.yml'
pull_request:
branches:
- master
workflow_call: null
jobs:
Style-Check:
uses: ./.github/workflows/check-style.yml
with:
trigger: "${{ github.event_name }}"
permissions:
contents: write
pull-requests: write
Build-and-Test:
runs-on: ubuntu-latest
timeout-minutes: 15
needs: Style-Check
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Set up JDK 19
uses: actions/setup-java@v4
with:
java-version: '19'
distribution: 'temurin'
- name: Create KeyStore and gradle.properties
run: |
storePass=dummyPassword
keyAlias=test
keyPass=dummyPassword
keytool -genkey -keystore keyStore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias "$keyAlias" \
-dname "cn=Unknown, ou=Unknown, o=Unknown, c=Unknown" -storepass "$storePass" -keypass "$keyPass"
mkdir -p ~/.gradle
echo "RELEASE_STORE_FILE=../keyStore.jks" >~/.gradle/gradle.properties
echo "RELEASE_STORE_PASSWORD=$storePass" >>~/.gradle/gradle.properties
echo "RELEASE_KEY_ALIAS=$keyAlias" >>~/.gradle/gradle.properties
echo "RELEASE_KEY_PASSWORD=$keyPass" >>~/.gradle/gradle.properties
- name: Build
run: |
chmod +x gradlew
./gradlew assembleLatest
- 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: Test
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 28
script: ./gradlew connectedLatestDebugAndroidTest