Skip to content

Commit ceb8c97

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

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

.github/workflows/test.yml

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

0 commit comments

Comments
 (0)