More dependencies and test instead of run
This commit is contained in:
15
.github/workflows/rust.yml
vendored
15
.github/workflows/rust.yml
vendored
@@ -18,9 +18,8 @@ jobs:
|
|||||||
run: brew install dbus
|
run: brew install dbus
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build --verbose --bin cli_app
|
run: cargo build --verbose --bin cli_app
|
||||||
- name: Run CLI
|
- name: test
|
||||||
run: cargo run --bin cli_app
|
run: cargo test
|
||||||
|
|
||||||
|
|
||||||
build-windows:
|
build-windows:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
@@ -30,16 +29,16 @@ jobs:
|
|||||||
run: choco install dbus -y
|
run: choco install dbus -y
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build --verbose --bin cli_app
|
run: cargo build --verbose --bin cli_app
|
||||||
- name: Run CLI
|
- name: test
|
||||||
run: cargo run --bin cli_app
|
run: cargo test
|
||||||
|
|
||||||
build-linux:
|
build-linux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: sudo apt update && sudo apt install -y libdbus-1-dev libhidapi-dev
|
run: sudo apt update && sudo apt install -y libdbus-1-dev libhidapi-dev libusb-1.0-0-dev
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build --verbose
|
run: cargo build --verbose
|
||||||
- name: Run CLI
|
- name: test
|
||||||
run: cargo run --bin cli_app
|
run: cargo test
|
||||||
@@ -16,4 +16,13 @@ fn main() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
println!("Battery level: {}%", battery_level);
|
println!("Battery level: {}%", battery_level);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_basic_device_access() {
|
||||||
|
let mut device = match Device::new() {
|
||||||
|
Ok(device) => device,
|
||||||
|
Err(error) => return
|
||||||
|
};
|
||||||
|
device.update_battery_level();
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user