Skip to content

Commit

Permalink
Merge pull request #16 from MalpenZibo/6_add-gh-action-code-checks
Browse files Browse the repository at this point in the history
Add CI checks
  • Loading branch information
MalpenZibo authored Sep 13, 2024
2 parents 75edeef + e9f8ef8 commit ad3952b
Show file tree
Hide file tree
Showing 15 changed files with 55 additions and 48 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always

jobs:
checks:
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: |
export DEBIAN_FRONTED=noninteractive
sudo apt-get update
sudo apt-get install -y pkg-config llvm-dev libclang-dev clang libxkbcommon-dev libwayland-dev dbus libpipewire-0.3-dev libpulse-dev
- name: Format
run: cargo fmt --all -- --check

- name: Clippy
run: cargo clippy --all-features -- -D warnings

- name: Build
run: cargo build


12 changes: 0 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ sysinfo = "0.30"
tokio = { version = "1", features = ["full"] }
zbus = "4.2"
libpulse-binding = { version = "2.28", features = ["pa_v15"] }
libpulse-tokio = "0.1"
inotify = "0.10"
log = { version = "0.4", features=["serde"] }
flexi_logger = "0.28"
Expand Down
2 changes: 1 addition & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ impl Application for App {
MenuType::Privacy => crate::menu::MenuPosition::Right,
MenuType::Settings => crate::menu::MenuPosition::Right,
},
self.config.position
self.config.position,
)
} else {
row!().into()
Expand Down
18 changes: 0 additions & 18 deletions src/centerbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,24 +289,6 @@ where
) -> Option<overlay::Element<'b, Message, Theme, Renderer>> {
overlay::from_children(&mut self.children, tree, layout, renderer, translation)
}

#[cfg(feature = "a11y")]
/// get the a11y nodes for the widget
fn a11y_nodes(
&self,
layout: Layout<'_>,
state: &Tree,
cursor: mouse::Cursor,
) -> iced_accessibility::A11yTree {
use iced_accessibility::A11yTree;
A11yTree::join(
self.children
.iter()
.zip(layout.children())
.zip(state.children.iter())
.map(|((c, c_layout), state)| c.as_widget().a11y_nodes(c_layout, state, cursor)),
)
}
}

impl<'a, Message, Theme, Renderer> From<Centerbox<'a, Message, Theme, Renderer>>
Expand Down
1 change: 0 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ pub struct SettingsModuleConfig {
pub bluetooth_more_cmd: Option<String>,
}


#[derive(Deserialize, Clone, Debug)]
#[serde(untagged)]
#[serde(rename_all = "camelCase")]
Expand Down
4 changes: 2 additions & 2 deletions src/menu.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use iced::window::Id;
use iced::Border;
use iced::{self, widget::container, Command, Element, Theme};
use iced_sctk::command::platform_specific::wayland::layer_surface::SctkLayerSurfaceSettings;
use iced_sctk::commands::layer_surface::{
self, get_layer_surface, Anchor, KeyboardInteractivity, Layer,
};
use iced::{self, widget::container, Command, Element, Theme};

use crate::config::Position;

Expand Down Expand Up @@ -166,7 +166,7 @@ pub enum MenuPosition {
pub fn menu_wrapper(
content: Element<crate::app::Message>,
position: MenuPosition,
bar_position: Position
bar_position: Position,
) -> Element<crate::app::Message> {
iced::widget::mouse_area(
container(
Expand Down
2 changes: 1 addition & 1 deletion src/modules/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pub mod clock;
pub mod launcher;
pub mod privacy;
pub mod settings;
pub mod system_info;
pub mod title;
pub mod updates;
pub mod workspaces;
pub mod privacy;
3 changes: 2 additions & 1 deletion src/modules/settings/battery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ use crate::{
},
};
use iced::{
widget::{container, row, text, Container}, Alignment, Background, Border, Element, Theme
widget::{container, row, text, Container},
Alignment, Background, Border, Element, Theme,
};

pub fn battery_indicator<'a, Message: 'static>(data: BatteryData) -> Element<'a, Message> {
Expand Down
7 changes: 5 additions & 2 deletions src/modules/settings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ use crate::{
use bluetooth::Bluetooth;
use brightness::{Brightness, BrightnessMessage};
use iced::{
alignment::{Horizontal, Vertical}, theme::Button, widget::{
alignment::{Horizontal, Vertical},
theme::Button,
widget::{
button, column, container, horizontal_space, row, text, vertical_rule, Column, Row, Space,
}, Alignment, Background, Border, Command, Element, Length, Subscription, Theme
},
Alignment, Background, Border, Command, Element, Length, Subscription, Theme,
};
use net::Net;

Expand Down
6 changes: 5 additions & 1 deletion src/modules/updates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ use crate::{
style::{GhostButtonStyle, HeaderButtonStyle},
};
use iced::{
alignment::Horizontal, subscription, theme::{self, Button}, widget::{button, column, container, horizontal_rule, row, scrollable, text, Column}, Alignment, Command, Element, Length, Subscription
alignment::Horizontal,
subscription,
theme::{self, Button},
widget::{button, column, container, horizontal_rule, row, scrollable, text, Column},
Alignment, Command, Element, Length, Subscription,
};
use log::error;
use serde::Deserialize;
Expand Down
2 changes: 0 additions & 2 deletions src/style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ pub fn left_header_pills(theme: &Theme) -> container::Appearance {
pub enum HeaderButtonStyle {
Full,
None,
Left,
Right,
}

Expand All @@ -154,7 +153,6 @@ impl button::StyleSheet for HeaderButtonStyle {
width: 0.0,
radius: match self {
HeaderButtonStyle::Full => 12.0.into(),
HeaderButtonStyle::Left => [12.0, 0.0, 0.0, 12.0].into(),
HeaderButtonStyle::Right => [0.0, 12.0, 12.0, 0.0].into(),
HeaderButtonStyle::None => 0.0.into(),
},
Expand Down
5 changes: 2 additions & 3 deletions src/utils/battery.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use crate::{components::icons::Icons, modules::settings::BatteryMessage};
use iced::{
futures::{
self, stream, FutureExt, SinkExt, StreamExt
}, subscription, Subscription
futures::{self, stream, FutureExt, SinkExt, StreamExt},
subscription, Subscription,
};
use log::error;
use std::time::Duration;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/idle_inhibitor.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::error::Error;
use log::{debug, info, warn};
use std::error::Error;
use wayland_client::{
protocol::{
wl_compositor::WlCompositor,
Expand Down
4 changes: 2 additions & 2 deletions src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ use std::{cell::RefCell, ops::Deref, time::Duration};

pub mod audio;
pub mod battery;
pub mod bluetooth;
pub mod brightness;
pub mod idle_inhibitor;
pub mod launcher;
pub mod net;
pub mod bluetooth;
pub mod powerprofiles;
pub mod privacy;
pub mod idle_inhibitor;

pub struct Commander<T> {
sender: tokio::sync::mpsc::UnboundedSender<T>,
Expand Down

0 comments on commit ad3952b

Please sign in to comment.