-
Notifications
You must be signed in to change notification settings - Fork 4
88 lines (82 loc) · 2.75 KB
/
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: "test"
on:
- push
jobs:
rust_test_linux:
runs-on: ubuntu-latest
container:
image: ubuntu:24.04
steps:
- name: Install basic requirements
run: |
apt-get update
apt-get install -y git curl unzip clang just
- uses: actions/checkout@v4
with:
submodules: true
- name: Install dependencies from apt
run: |
apt-get install -y libdbus-1-dev pkg-config libgtk-4-dev libadwaita-1-dev protobuf-compiler
- name: Install display server
run: |
apt-get install -y xvfb
- name: Install rust
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Cache cargo dependencies
uses: Swatinem/rust-cache@v2
- name: Run rust tests
run: xvfb-run --auto-servernum just test-cov
- name: Generate HTML test coverage report
run: just test-cov-report html
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage
path: target/llvm-cov/html/
# Only lib is tested on windows since building gtk takes too long, and lib is the only crate with os specific code
rust_test_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install just
run: choco install just
- name: Install rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo dependencies
uses: Swatinem/rust-cache@v2
- name: Run lib tests
run: just lib/ test
android_test:
runs-on: ubuntu-latest
steps:
- name: Set ANDROID_NDK_HOME to latest NDK version
run: |
echo "ANDROID_NDK_HOME=$ANDROID_NDK_LATEST_HOME" >> "$GITHUB_ENV"
- uses: actions/checkout@v4
with:
submodules: true
- name: Install protoc
run: sudo apt install -y protobuf-compiler
- name: Install rust
uses: dtolnay/rust-toolchain@stable
with:
targets: armv7-linux-androideabi,aarch64-linux-android,i686-linux-android,x86_64-linux-android
- uses: actions/setup-java@v4
with:
distribution: temurin # See 'Supported distributions' for available options
java-version: 17
- uses: gradle/actions/setup-gradle@v4
- name: Cache cargo dependencies
uses: Swatinem/rust-cache@v2
- name: Install cargo-ndk
run: cargo install cargo-ndk
- name: Run android unit tests
working-directory: android
run: ./gradlew testBluetoothDebugUnitTest
# - name: Run android instrumented tests
# working-directory: android
# run: ./gradlew connectedAndroidTest