From 4b751dc24626296b8b3bf52eeb4b1475eb997087 Mon Sep 17 00:00:00 2001 From: Austin Schaefer Date: Wed, 29 Jul 2026 12:03:01 +0200 Subject: [PATCH 1/4] Add Forgejo Actions CI workflow Runs cargo fmt/clippy/test/audit via the existing cargo-make ci task on every push and pull request. Co-Authored-By: Claude Sonnet 5 --- .forgejo/workflows/ci.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .forgejo/workflows/ci.yml diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml new file mode 100644 index 0000000..5618cf9 --- /dev/null +++ b/.forgejo/workflows/ci.yml @@ -0,0 +1,35 @@ +name: CI + +on: + push: + pull_request: + +jobs: + ci: + runs-on: docker + container: rust:latest + steps: + - uses: actions/checkout@v4 + + - name: Cache cargo + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/bin + target + key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- + + - name: Install toolchain components + run: rustup component add clippy rustfmt + + - name: Install cargo-make and cargo-audit + run: | + for crate in cargo-make cargo-audit; do + command -v "$crate" >/dev/null 2>&1 || cargo install "$crate" + done + + - name: Run CI checks + run: cargo make ci From d1fd272fbbeb0ad777684da5e579aba6475940d5 Mon Sep 17 00:00:00 2001 From: Austin Schaefer Date: Wed, 29 Jul 2026 12:12:57 +0200 Subject: [PATCH 2/4] Fix rustfmt formatting in icon.rs Reorders imports and reflows a long binding so the new CI's format-check job passes. Co-Authored-By: Claude Sonnet 5 --- src/icon.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/icon.rs b/src/icon.rs index 02fd7d9..424922c 100644 --- a/src/icon.rs +++ b/src/icon.rs @@ -1,5 +1,6 @@ use freedesktop_icons::lookup; use std::path::PathBuf; +use std::{env, fs}; const ICON_SIZE: u16 = 32; @@ -47,7 +48,7 @@ fn desktop_file_icon_name(desktop_entry: &str) -> Option { let path = dir .join("applications") .join(format!("{desktop_entry}.desktop")); - if let Ok(contents) = std::fs::read_to_string(&path) + if let Ok(contents) = fs::read_to_string(&path) && let Some(icon) = parse_icon_key(&contents) { return Some(icon); @@ -58,11 +59,11 @@ fn desktop_file_icon_name(desktop_entry: &str) -> Option { fn data_dirs() -> Vec { let mut dirs = vec![]; - if let Some(home) = std::env::var_os("HOME") { + if let Some(home) = env::var_os("HOME") { dirs.push(PathBuf::from(home).join(".local/share")); } - let xdg_data_dirs = std::env::var("XDG_DATA_DIRS") - .unwrap_or_else(|_| "/usr/local/share:/usr/share".to_string()); + let xdg_data_dirs = + env::var("XDG_DATA_DIRS").unwrap_or_else(|_| "/usr/local/share:/usr/share".to_string()); dirs.extend(xdg_data_dirs.split(':').map(PathBuf::from)); dirs } From 4e65ef384329c3c428fc32143abe72a7829e53e6 Mon Sep 17 00:00:00 2001 From: Austin Schaefer Date: Wed, 29 Jul 2026 12:25:09 +0200 Subject: [PATCH 3/4] Fix CI job: run on default node image instead of rust:latest The rust:latest container has no Node.js, but actions/checkout@v4 and actions/cache@v4 are JS actions that require it to execute at all, so the job failed before any cargo/fmt steps ran. Use the default docker runner image and install the Rust toolchain via rustup instead. Co-Authored-By: Claude Sonnet 5 --- .forgejo/workflows/ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 5618cf9..80f318d 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -7,7 +7,6 @@ on: jobs: ci: runs-on: docker - container: rust:latest steps: - uses: actions/checkout@v4 @@ -22,8 +21,10 @@ jobs: restore-keys: | ${{ runner.os }}-cargo- - - name: Install toolchain components - run: rustup component add clippy rustfmt + - name: Install Rust toolchain + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal --component clippy --component rustfmt + echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" - name: Install cargo-make and cargo-audit run: | From 1cda8b6f504934f7436df4168408b1b6275985f1 Mon Sep 17 00:00:00 2001 From: Austin Schaefer Date: Wed, 29 Jul 2026 12:29:11 +0200 Subject: [PATCH 4/4] Only trigger CI push runs on master to avoid duplicate builds Pushing to a branch with an open PR fired both the push and pull_request triggers for the same commit. pull_request already covers feature-branch commits, so push only needs to cover master. Co-Authored-By: Claude Sonnet 5 --- .forgejo/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 80f318d..eb6b277 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -2,6 +2,7 @@ name: CI on: push: + branches: [master] pull_request: jobs: