Skip to content

Commit

Permalink
Merge pull request #81 from perlindgren/ci
Browse files Browse the repository at this point in the history
Add Windows, MacOS targets to CI, bump actions versions, fix clippy warnings
  • Loading branch information
onsdagens authored Jul 3, 2024
2 parents 7ea181d + 09401a6 commit 613521a
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 15 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Rust

on:
push:
branches: ["master", "egui_generic"]
branches: ["master", "ci"]
pull_request:
branches: ["master"]

Expand All @@ -12,8 +12,12 @@ env:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [x86_64-pc-windows-gnu, x86_64-unknown-linux-musl, x86_64-apple-darwin]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Update runner
run: sudo apt-get update
- name: Install dependencies
Expand All @@ -24,11 +28,11 @@ jobs:
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --verbose
- uses: actions-rs/clippy-check@v1
- uses: clechasseur/rs-clippy-check@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --no-default-features --features gui-vizia
- uses: actions-rs/clippy-check@v1
- uses: clechasseur/rs-clippy-check@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --no-default-features --features gui-egui
Expand All @@ -37,7 +41,7 @@ jobs:
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: Swatinem/rust-cache@v2

Expand Down
9 changes: 7 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,18 @@ typetag = "0.2.10"

[dependencies.vizia]
git = "https://github.com/vizia/vizia.git"
# path = "../vizia"
#path = "../vizia"
optional = true

[dependencies.egui]
optional = true
version = "0.23.0"

[dependencies.winapi]
optional = true
version = "0.3.9"
features = ["winuser"]

[dependencies.eframe]
optional = true
version = "0.23.0"
Expand All @@ -43,7 +48,7 @@ version = "0.23.0"
default = ["gui-egui"]
components = []
gui-vizia = ["vizia", "components"]
gui-egui = ["egui", "eframe", "epaint", "components"]
gui-egui = ["egui", "eframe", "epaint", "winapi", "components"]

[profile.dev]
debug = 1 # faster build, still allows for stack back trace
Expand Down
2 changes: 1 addition & 1 deletion src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ pub trait EguiComponent: Component {
}

fn set_id_tmp(&self, context: &mut EguiExtra) {
context.id_tmp = self.get_id_ports().0.clone();
context.id_tmp.clone_from(&self.get_id_ports().0);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/gui_egui/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ pub fn get_component(components: &Components, comp: CloseToComponent) -> Option<
for (i, c) in components.iter().enumerate() {
// doing std::ptr::eq doesn't work and this works so I'm going to keep it
// even if clippy errors on it
#[allow(clippy::vtable_address_comparisons)]
#[allow(ambiguous_wide_pointer_comparisons)]
if Rc::ptr_eq(c, &comp.comp) {
drop(comp);
return Some(i);
Expand Down
2 changes: 1 addition & 1 deletion src/gui_egui/editor_wire_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pub fn last_click(e: &mut Editor, closest_uw: CloseToComponent) {
pos_v.append(&mut v);

// Now actually set the input of the wired component
#[allow(clippy::vtable_address_comparisons)]
#[allow(ambiguous_wide_pointer_comparisons)]
if !Rc::ptr_eq(&in_c.comp, &out_c.comp) {
let comp = if is_input_in_comp_start { out_c } else { in_c };
e.components.push(Rc::new(Wire {
Expand Down
2 changes: 1 addition & 1 deletion src/gui_vizia/components/probe_edit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl ViziaComponent for ProbeEdit {
//cx.emit(ProbeEditViewSetter::EditableText(text));
},
)
.on_submit(move |ex, text, enter| {
.on_submit(move |_, text, enter| {
trace!("submit: text {} enter {}", text, enter);
//ex.emit(ProbeEditViewSetter::EditableText(text));
})
Expand Down
2 changes: 1 addition & 1 deletion src/gui_vizia/gui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ pub fn gui(cs: ComponentStore, path: &PathBuf) {
let path = path.to_owned();
simulator.save_dot(&path);

Application::new(move |cx| {
let _ = Application::new(move |cx| {
cx.add_stylesheet(include_style!("src/gui_vizia/style.css"))
.expect("Failed to add stylesheet");

Expand Down
2 changes: 0 additions & 2 deletions src/gui_vizia/popup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ use vizia::prelude::*;

use log::*;

use crate::gui_vizia::popup::popup_data_derived_lenses::is_open;

pub fn build_popup(cx: &mut Context, id_ports: (Id, Ports)) -> Handle<'_, Popup> {
trace!("build_popup");
PopupData::default().build(cx);
Expand Down
2 changes: 1 addition & 1 deletion src/simulator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ impl Simulator {
.get(&(id.into(), field.into()))
.unwrap_or_else(|| panic!("Component {}, field {} not found.", id, field));
let start_index = self.get_id_start_index(id);
let val: SignalValue = value.try_into().unwrap();
let val: SignalValue = value.into();
//trace!("id:{}, field:{}, value:{:?}", id,field, SignalValue::try_from(val).unwrap());
self.set_value(start_index + index, val);
}
Expand Down

0 comments on commit 613521a

Please sign in to comment.