From 3fcd71f80cd660a1bc05aca744e0f1e9ad9ba495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mikrut?= Date: Mon, 20 Nov 2023 17:18:04 +0100 Subject: [PATCH] Traits --- .github/workflows/linux_cli.yml | 5 +--- .github/workflows/linux_cli_eyra.yml | 2 +- .github/workflows/linux_gui.yml | 42 +++++++++++++--------------- .github/workflows/mac.yml | 4 --- .github/workflows/quality.yml | 4 +-- .github/workflows/windows.yml | 10 ++++++- krokiet/Cargo.toml | 5 ++-- krokiet/src/connect_delete.rs | 4 +-- 8 files changed, 37 insertions(+), 39 deletions(-) diff --git a/.github/workflows/linux_cli.yml b/.github/workflows/linux_cli.yml index ba10798..053f22f 100644 --- a/.github/workflows/linux_cli.yml +++ b/.github/workflows/linux_cli.yml @@ -19,16 +19,13 @@ jobs: - uses: actions/checkout@v3 - name: Install basic libraries - run: sudo apt update; sudo apt install libheif-dev ffmpeg -y + run: sudo apt update || true; sudo apt install libheif-dev ffmpeg -y - name: Setup rust version run: rustup default ${{ matrix.toolchain }} - name: Build Release run: cargo build --release --bin czkawka_cli - env: - CARGO_INCREMENTAL: 0 - RUSTFLAGS: "-C debuginfo=0" if: ${{ (matrix.type == 'release') }} - name: Store Linux CLI diff --git a/.github/workflows/linux_cli_eyra.yml b/.github/workflows/linux_cli_eyra.yml index 12463da..43d9b72 100644 --- a/.github/workflows/linux_cli_eyra.yml +++ b/.github/workflows/linux_cli_eyra.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v3 - name: Install basic libraries - run: sudo apt update; sudo apt install -y ffmpeg + run: sudo apt update || true; sudo apt install -y ffmpeg - name: Setup rust version run: rustup default ${{ matrix.toolchain }} diff --git a/.github/workflows/linux_gui.yml b/.github/workflows/linux_gui.yml index b647bf1..c108386 100644 --- a/.github/workflows/linux_gui.yml +++ b/.github/workflows/linux_gui.yml @@ -19,16 +19,13 @@ jobs: - uses: actions/checkout@v3 - name: Install basic libraries - run: sudo apt update; sudo apt install libheif-dev -y + run: sudo apt update || true; sudo apt install libheif-dev -y - name: Setup rust version run: rustup default ${{ matrix.toolchain }} - name: Build Release Krokiet run: cargo build --release --bin krokiet - env: - CARGO_INCREMENTAL: 0 - RUSTFLAGS: "-C debuginfo=0" if: ${{ (matrix.type == 'release') }} - name: Store Linux GUI Krokiet @@ -38,11 +35,23 @@ jobs: path: target/release/krokiet if: ${{ matrix.type == 'release' }} + linux-krokiet-gui-heif: + strategy: + matrix: + toolchain: [ stable, 1.72.1 ] + type: [ release ] + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + + - name: Install basic libraries + run: sudo apt update || true; sudo apt install libheif-dev -y + + - name: Setup rust version + run: rustup default ${{ matrix.toolchain }} + - name: Build Release Krokiet heif run: cargo build --release --bin krokiet --features heif - env: - CARGO_INCREMENTAL: 0 - RUSTFLAGS: "-C debuginfo=0" if: ${{ (matrix.type == 'release') }} - name: Store Linux GUI Krokiet heif @@ -52,7 +61,6 @@ jobs: path: target/release/krokiet if: ${{ matrix.type == 'release' }} - linux-gui: strategy: matrix: @@ -63,16 +71,13 @@ jobs: - uses: actions/checkout@v3 - name: Install basic libraries - run: sudo apt update; sudo apt install libgtk-4-dev libheif-dev -y + run: sudo apt update || true; sudo apt install libgtk-4-dev libheif-dev -y - name: Setup rust version run: rustup default ${{ matrix.toolchain }} - name: Build Release Heif run: cargo build --release --bin czkawka_gui --features heif - env: - CARGO_INCREMENTAL: 0 - RUSTFLAGS: "-C debuginfo=0" if: ${{ (matrix.type == 'release') }} - name: Store Linux GUI Heif @@ -84,9 +89,6 @@ jobs: - name: Build Release run: cargo build --release --bin czkawka_gui - env: - CARGO_INCREMENTAL: 0 - RUSTFLAGS: "-C debuginfo=0" if: ${{ (matrix.type == 'release') }} # Only store stable toolchain @@ -107,16 +109,13 @@ jobs: - uses: actions/checkout@v3 - name: Install Dependencies - run: sudo apt update; sudo apt install libgtk-4-dev libheif-dev librsvg2-dev wget fuse libfuse2 -y + run: sudo apt update || true; sudo apt install libgtk-4-dev libheif-dev librsvg2-dev wget fuse libfuse2 -y - name: Setup rust version run: rustup default ${{ matrix.toolchain }} - name: Build Release run: cargo build --release --bin czkawka_gui - env: - CARGO_INCREMENTAL: 0 - RUSTFLAGS: "-C debuginfo=0" - name: Download appimage dependencies run: | @@ -163,13 +162,10 @@ jobs: - uses: actions/checkout@v3 - name: Install Dependencies - run: sudo apt update; sudo apt install libgtk-4-dev libheif-dev librsvg2-dev wget fuse libfuse2 -y xvfb + run: sudo apt update || true; sudo apt install libgtk-4-dev libheif-dev librsvg2-dev wget fuse libfuse2 -y xvfb - name: Setup rust version run: rustup default ${{ matrix.toolchain }} - name: Test run: xvfb-run cargo test - env: - CARGO_INCREMENTAL: 0 - RUSTFLAGS: "-C debuginfo=0" diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 4e953ce..a9b8861 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -32,8 +32,6 @@ jobs: - name: Build Release run: cargo build --release - env: - CARGO_INCREMENTAL: 0 if: ${{ matrix.type == 'release'}} - name: Store MacOS CLI @@ -59,8 +57,6 @@ jobs: - name: Build Release Heif run: cargo build --release --features heif - env: - CARGO_INCREMENTAL: 0 if: ${{ matrix.type == 'release'}} - name: Store MacOS CLI Heif diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index efd152b..d1c7b9d 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v3 - name: Install Gtk 4 - run: sudo apt update; sudo apt install -y libgtk-4-dev libheif-dev -y + run: sudo apt update || true; sudo apt install -y libgtk-4-dev libheif-dev -y - name: Check the format run: cargo fmt --all -- --check @@ -23,4 +23,4 @@ jobs: # Clippy overly_complex_bool_expr is disabled because mess with generated files in target dir # and I cannot disable it - name: Run clippy - run: cargo clippy --all-targets --all-features -- -A clippy::overly_complex_bool_expr -D warnings + run: cargo clippy --all-targets --all-features -- -D warnings diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 5d91586..f4850f1 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -18,6 +18,14 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Install dependencies(mostly sd) + run: | + sudo apt update || true; sudo apt install wget -y + wget https://github.com/chmln/sd/releases/download/v1.0.0/sd-v1.0.0-x86_64-unknown-linux-gnu.tar.gz -O a.tar.gz + tar -xzf a.tar.gz + chmod +x sd-v1.0.0-x86_64-unknown-linux-gnu/sd + sudo cp sd-v1.0.0-x86_64-unknown-linux-gnu/sd /usr/bin/sd + - name: Setup rust version run: rustup default ${{ matrix.toolchain }} @@ -33,7 +41,7 @@ jobs: if-no-files-found: error - name: Show console window on windows - run: sed -i 's|\#\!\[windows_subsystem|//#![windows_subsystem|' krokiet/src/main.rs + run: sd -s '#![windows_subsystem = "windows"]' '//#![windows_subsystem = "windows"]' krokiet/src/main.rs - name: Compile Krokiet Console run: cargo build --release --bin krokiet diff --git a/krokiet/Cargo.toml b/krokiet/Cargo.toml index de5a113..3053d66 100644 --- a/krokiet/Cargo.toml +++ b/krokiet/Cargo.toml @@ -41,7 +41,6 @@ slint-build = "1.3" #slint-build = { path = "/home/rafal/test/slint/api/rs/build/"} [features] -# TODO remove from deault features skia, because is harder to cross-compile it default = ["winit_femtovg", "winit_software"] skia_opengl = ["slint/renderer-skia-opengl"] skia_vulkan = ["slint/renderer-skia-vulkan"] @@ -50,4 +49,6 @@ femtovg = ["slint/renderer-femtovg"] winit_femtovg = ["slint/renderer-winit-femtovg"] winit_skia_opengl = ["slint/renderer-winit-skia-opengl"] winit_skia_vulkan = ["slint/renderer-winit-skia-vulkan"] -winit_software = ["slint/renderer-winit-software"] \ No newline at end of file +winit_software = ["slint/renderer-winit-software"] + +heif = ["czkawka_core/heif"] diff --git a/krokiet/src/connect_delete.rs b/krokiet/src/connect_delete.rs index 46ab2eb..1453ac9 100644 --- a/krokiet/src/connect_delete.rs +++ b/krokiet/src/connect_delete.rs @@ -158,13 +158,13 @@ mod tests { } #[test] - #[should_panic(expected = "First item in normal model, cannot be header")] + #[should_panic] fn test_filter_out_checked_items_one_element_invalid_normal() { let items = create_new_model(vec![(false, true, false, vec![])]); filter_out_checked_items(&items, false); } #[test] - #[should_panic(expected = "First item in header model must be a header")] + #[should_panic] fn test_filter_out_checked_items_one_element_invalid_header() { let items = create_new_model(vec![(false, false, false, vec![])]); filter_out_checked_items(&items, true);