Skip to content

Commit d195c4d

Browse files
committed
Run tests on push and pull request
1 parent 050c19f commit d195c4d

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/test.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: DNSNet Test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
api-level: [35]
11+
steps:
12+
- name: checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Enable KVM
16+
run: |
17+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
18+
sudo udevadm control --reload-rules
19+
sudo udevadm trigger --name-match=kvm
20+
21+
- name: Gradle cache
22+
uses: gradle/actions/setup-gradle@v3
23+
24+
- name: AVD cache
25+
uses: actions/cache@v4
26+
id: avd-cache
27+
with:
28+
path: |
29+
~/.android/avd/*
30+
~/.android/adb*
31+
key: avd-${{ matrix.api-level }}
32+
33+
- name: create AVD and generate snapshot for caching
34+
if: steps.avd-cache.outputs.cache-hit != 'true'
35+
uses: reactivecircus/android-emulator-runner@v2
36+
with:
37+
api-level: ${{ matrix.api-level }}
38+
force-avd-creation: false
39+
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
40+
disable-animations: false
41+
script: echo "Generated AVD snapshot for caching."
42+
43+
- name: Run tests
44+
uses: reactivecircus/android-emulator-runner@v2
45+
with:
46+
api-level: ${{ matrix.api-level }}
47+
script: ./gradlew :app:connectedCheck

0 commit comments

Comments
 (0)