Skip to content

Commit adee5a0

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

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

.github/workflows/test.yml

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

0 commit comments

Comments
 (0)