mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-01-22 09:23:19 +01:00
Chore: flush out requirement for nightly
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
echo '+cargo +nightly fmt --all -- --check'
|
echo '+cargo fmt --all -- --check'
|
||||||
cargo +nightly fmt --all -- --check
|
cargo fmt --all -- --check
|
||||||
git add -u
|
git add -u
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
echo '+cargo +nightly fmt --all -- --check'
|
echo '+cargo fmt --all -- --check'
|
||||||
cargo +nightly fmt --all -- --check
|
cargo fmt --all -- --check
|
||||||
echo '+cargo clippy --all -- -D warnings'
|
echo '+cargo clippy --all -- -D warnings'
|
||||||
cargo clippy --all -- -D warnings
|
cargo clippy --all -- -D warnings
|
||||||
echo '+cargo cranky'
|
echo '+cargo cranky'
|
||||||
|
|||||||
@@ -31,8 +31,7 @@ format:
|
|||||||
- tags
|
- tags
|
||||||
<<: *rust_cache
|
<<: *rust_cache
|
||||||
script:
|
script:
|
||||||
- echo "nightly" > rust-toolchain
|
- rustup component add rustfmt || true
|
||||||
- rustup component add rustfmt
|
|
||||||
- cargo fmt --check
|
- cargo fmt --check
|
||||||
|
|
||||||
check:
|
check:
|
||||||
@@ -40,8 +39,8 @@ check:
|
|||||||
- tags
|
- tags
|
||||||
<<: *rust_cache
|
<<: *rust_cache
|
||||||
script:
|
script:
|
||||||
- rustup component add clippy
|
- rustup component add clippy || true
|
||||||
- cargo check
|
- cargo check --locked --workspace
|
||||||
# deny currently catches too much
|
# deny currently catches too much
|
||||||
#- cargo install cargo-deny && cargo deny
|
#- cargo install cargo-deny && cargo deny
|
||||||
- cargo install cargo-cranky && cargo cranky
|
- cargo install cargo-cranky && cargo cranky
|
||||||
@@ -52,7 +51,7 @@ test:
|
|||||||
<<: *rust_cache
|
<<: *rust_cache
|
||||||
script:
|
script:
|
||||||
- mkdir -p .git/hooks > /dev/null
|
- mkdir -p .git/hooks > /dev/null
|
||||||
- cargo test --all -- --test-threads=1
|
- cargo test --locked --all
|
||||||
|
|
||||||
release:
|
release:
|
||||||
only:
|
only:
|
||||||
@@ -60,7 +59,7 @@ release:
|
|||||||
<<: *rust_cache
|
<<: *rust_cache
|
||||||
script:
|
script:
|
||||||
- cargo install cargo-vendor-filterer
|
- cargo install cargo-vendor-filterer
|
||||||
- make && make vendor
|
- make FROZEN=1 && make vendor
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- vendor_asusctl*.tar.xz
|
- vendor_asusctl*.tar.xz
|
||||||
@@ -72,7 +71,7 @@ pages:
|
|||||||
- tags
|
- tags
|
||||||
<<: *rust_cache
|
<<: *rust_cache
|
||||||
script:
|
script:
|
||||||
- cargo doc --document-private-items --no-deps --workspace
|
- cargo doc --locked --document-private-items --no-deps --workspace
|
||||||
- rm -rf public
|
- rm -rf public
|
||||||
- mkdir public
|
- mkdir public
|
||||||
- cp -R target/doc/* public
|
- cp -R target/doc/* public
|
||||||
|
|||||||
9
Makefile
9
Makefile
@@ -37,6 +37,15 @@ ifeq ($(X11),1)
|
|||||||
ARGS += --features "rog-control-center/x11"
|
ARGS += --features "rog-control-center/x11"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Always use the versions in Cargo.lock by default
|
||||||
|
ARGS += --locked
|
||||||
|
|
||||||
|
# Allow optionally freezing the build to avoid any network access and enforce Cargo.lock strictly
|
||||||
|
FROZEN ?= 0
|
||||||
|
ifeq ($(FROZEN),1)
|
||||||
|
ARGS += --frozen
|
||||||
|
endif
|
||||||
|
|
||||||
VENDORED ?= 0
|
VENDORED ?= 0
|
||||||
ifeq ($(VENDORED),1)
|
ifeq ($(VENDORED),1)
|
||||||
ARGS += --frozen
|
ARGS += --frozen
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ A gui is now in the repo - ROG Control Center. At this time it is still a WIP, b
|
|||||||
|
|
||||||
Rust and cargo are required, they can be installed from [rustup.rs](https://rustup.rs/).
|
Rust and cargo are required, they can be installed from [rustup.rs](https://rustup.rs/).
|
||||||
|
|
||||||
Distro repos probably won't work (unless rustup is shipped like in the case of archlinux) as nightly is needed.
|
Distro packaging should work with the stable toolchain. If your distro does not provide a recent Rust toolchain, install rustup and use the stable toolchain.
|
||||||
|
|
||||||
**fedora:**
|
**fedora:**
|
||||||
|
|
||||||
|
|||||||
@@ -231,6 +231,8 @@ impl AuraConfig {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
use std::sync::{Mutex, MutexGuard, OnceLock};
|
||||||
|
|
||||||
use rog_aura::keyboard::AuraPowerState;
|
use rog_aura::keyboard::AuraPowerState;
|
||||||
use rog_aura::{
|
use rog_aura::{
|
||||||
AuraEffect, AuraModeNum, AuraZone, Colour, Direction, LedBrightness, PowerZones, Speed,
|
AuraEffect, AuraModeNum, AuraZone, Colour, Direction, LedBrightness, PowerZones, Speed,
|
||||||
@@ -238,8 +240,20 @@ mod tests {
|
|||||||
|
|
||||||
use super::AuraConfig;
|
use super::AuraConfig;
|
||||||
|
|
||||||
|
// Global mutex to serialize tests that rely on process-wide environment
|
||||||
|
// variables
|
||||||
|
static TEST_MUTEX: OnceLock<Mutex<()>> = OnceLock::new();
|
||||||
|
|
||||||
|
fn test_lock() -> MutexGuard<'static, ()> {
|
||||||
|
TEST_MUTEX
|
||||||
|
.get_or_init(|| Mutex::new(()))
|
||||||
|
.lock()
|
||||||
|
.expect("TEST_MUTEX poisoned")
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn set_multizone_4key_config() {
|
fn set_multizone_4key_config() {
|
||||||
|
let _guard = test_lock();
|
||||||
std::env::set_var("BOARD_NAME", "");
|
std::env::set_var("BOARD_NAME", "");
|
||||||
let mut config = AuraConfig::new("19b6");
|
let mut config = AuraConfig::new("19b6");
|
||||||
|
|
||||||
@@ -319,6 +333,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn set_multizone_multimode_config() {
|
fn set_multizone_multimode_config() {
|
||||||
|
let _guard = test_lock();
|
||||||
std::env::set_var("BOARD_NAME", "");
|
std::env::set_var("BOARD_NAME", "");
|
||||||
let mut config = AuraConfig::new("19b6");
|
let mut config = AuraConfig::new("19b6");
|
||||||
|
|
||||||
@@ -367,6 +382,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn verify_0x1866_g531i() {
|
fn verify_0x1866_g531i() {
|
||||||
|
let _guard = test_lock();
|
||||||
std::env::set_var("BOARD_NAME", "G513I");
|
std::env::set_var("BOARD_NAME", "G513I");
|
||||||
let mut config = AuraConfig::new("1866");
|
let mut config = AuraConfig::new("1866");
|
||||||
|
|
||||||
@@ -392,6 +408,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn verify_0x19b6_g634j() {
|
fn verify_0x19b6_g634j() {
|
||||||
|
let _guard = test_lock();
|
||||||
std::env::set_var("BOARD_NAME", "G634J");
|
std::env::set_var("BOARD_NAME", "G634J");
|
||||||
let mut config = AuraConfig::new("19b6");
|
let mut config = AuraConfig::new("19b6");
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ edition.workspace = true
|
|||||||
default = []
|
default = []
|
||||||
mocking = []
|
mocking = []
|
||||||
x11 = ["slint/backend-winit-x11"]
|
x11 = ["slint/backend-winit-x11"]
|
||||||
# Requires RUSTFLAGS="--cfg tokio_unstable"
|
# Optional tokio debug feature does not require nightly; remove RUSTFLAGS note.
|
||||||
tokio-debug = ["console-subscriber"]
|
tokio-debug = ["console-subscriber"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
Reference in New Issue
Block a user