From 151c6529c4c45c158e89f5d1d04f923c443e26bb Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Sun, 5 Apr 2026 00:35:58 -0400 Subject: [PATCH 01/12] ci: add rust workflow with pinned action versions and fix clippy warnings - Add GitHub Actions workflow for build, test, format, and lint - Use ratchet to pin action versions by SHA - Fix clippy::collapsible_if warnings in rutt-tui/src/main.rs --- .github/workflows/rust.yml | 36 ++++++++++++++++++++++++++++++++++++ rutt-tui/src/main.rs | 8 +++----- 2 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/rust.yml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..9880f9c --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,36 @@ +name: Rust + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # ratchet:dtolnay/rust-toolchain@stable + with: + components: rustfmt, clippy + + - name: Cache dependencies + uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # ratchet:Swatinem/rust-cache@v2 + + - name: Check format + run: cargo fmt --all -- --check + + - name: Lint with clippy + run: cargo clippy --workspace --all-targets --all-features -- -D warnings + + - name: Build + run: cargo build --workspace --verbose + + - name: Run tests + run: cargo test --workspace --verbose diff --git a/rutt-tui/src/main.rs b/rutt-tui/src/main.rs index 64c21e8..1c63ac0 100644 --- a/rutt-tui/src/main.rs +++ b/rutt-tui/src/main.rs @@ -63,9 +63,9 @@ async fn run_app( ui(f, state); })?; - if event::poll(std::time::Duration::from_millis(16))? { - if let Event::Key(key) = event::read()? { - if key.kind == KeyEventKind::Press { + if event::poll(std::time::Duration::from_millis(16))? + && let Event::Key(key) = event::read()? + && key.kind == KeyEventKind::Press { let action = match key.code { KeyCode::Char('q') => Some(Action::Quit), KeyCode::Char('k') | KeyCode::Up => Some(Action::MoveUp), @@ -84,8 +84,6 @@ async fn run_app( state.handle_action(action, visible_height); } } - } - } } } From c1c9832e7eb8e2a3f6bb893d9e09a56187f4061b Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Sun, 5 Apr 2026 00:39:44 -0400 Subject: [PATCH 02/12] ci: add ratchet workflow to lint action pinning Ensures all GitHub Actions in .github/workflows/ are pinned to specific SHAs. --- .github/workflows/ratchet.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/ratchet.yml diff --git a/.github/workflows/ratchet.yml b/.github/workflows/ratchet.yml new file mode 100644 index 0000000..524c8e1 --- /dev/null +++ b/.github/workflows/ratchet.yml @@ -0,0 +1,18 @@ +name: Ratchet + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +jobs: + ratchet: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4 + + - name: Ratchet Lint + uses: sethvargo/ratchet@27f7515b4648e179168f8f8ae2257636fdb03c48 # ratchet:sethvargo/ratchet@main + with: + args: lint .github/workflows From 61f28aea7062274d9c33bf56a5f93cebde9027a4 Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Sun, 5 Apr 2026 00:40:27 -0400 Subject: [PATCH 03/12] ci: add actionlint workflow to lint GitHub Actions Validates syntax, expressions, and best practices for all YAML workflows. --- .github/workflows/actionlint.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/actionlint.yml diff --git a/.github/workflows/actionlint.yml b/.github/workflows/actionlint.yml new file mode 100644 index 0000000..ce2c70d --- /dev/null +++ b/.github/workflows/actionlint.yml @@ -0,0 +1,22 @@ +name: actionlint + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +jobs: + actionlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4 + + - name: Download actionlint + shell: bash + run: | + bash <(curl -s https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) + + - name: Run actionlint + shell: bash + run: ./actionlint -color From 84f0b513db018c53b87240fccfcc4057cb759a30 Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Sun, 5 Apr 2026 00:46:41 -0400 Subject: [PATCH 04/12] manual tweaks --- .github/workflows/actionlint.yml | 18 ++++++------------ .github/workflows/ratchet.yml | 4 ---- .github/workflows/rust.yml | 9 ++------- 3 files changed, 8 insertions(+), 23 deletions(-) diff --git a/.github/workflows/actionlint.yml b/.github/workflows/actionlint.yml index ce2c70d..110b7c6 100644 --- a/.github/workflows/actionlint.yml +++ b/.github/workflows/actionlint.yml @@ -1,22 +1,16 @@ -name: actionlint - on: push: - branches: ["main"] pull_request: - branches: ["main"] jobs: actionlint: runs-on: ubuntu-latest steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4 + with: + show-progress: false + sparse-checkout: '.github/' - - name: Download actionlint - shell: bash - run: | - bash <(curl -s https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) - - - name: Run actionlint - shell: bash - run: ./actionlint -color + - uses: docker://index.docker.io/rhysd/actionlint@sha256:887a259a5a534f3c4f36cb02dca341673c6089431057242cdc931e9f133147e9 # ratchet:docker://rhysd/actionlint:1.7.7 + with: + args: -color diff --git a/.github/workflows/ratchet.yml b/.github/workflows/ratchet.yml index 524c8e1..782a584 100644 --- a/.github/workflows/ratchet.yml +++ b/.github/workflows/ratchet.yml @@ -1,10 +1,6 @@ -name: Ratchet - on: push: - branches: ["main"] pull_request: - branches: ["main"] jobs: ratchet: diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9880f9c..dcb0a9f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,10 +1,6 @@ -name: Rust - on: push: - branches: ["main"] pull_request: - branches: ["main"] env: CARGO_TERM_COLOR: always @@ -14,15 +10,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4 + with: + show-progress: false - name: Install Rust toolchain uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # ratchet:dtolnay/rust-toolchain@stable with: components: rustfmt, clippy - - name: Cache dependencies - uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # ratchet:Swatinem/rust-cache@v2 - - name: Check format run: cargo fmt --all -- --check From 23aa6abf35d5b2fa855f3a7d00634724d0ff5b10 Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Sun, 5 Apr 2026 00:49:13 -0400 Subject: [PATCH 05/12] upgrade ratchet versions --- .github/workflows/actionlint.yml | 4 ++-- .github/workflows/ratchet.yml | 2 +- .github/workflows/rust.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/actionlint.yml b/.github/workflows/actionlint.yml index 110b7c6..9aa8794 100644 --- a/.github/workflows/actionlint.yml +++ b/.github/workflows/actionlint.yml @@ -6,11 +6,11 @@ jobs: actionlint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6 with: show-progress: false sparse-checkout: '.github/' - - uses: docker://index.docker.io/rhysd/actionlint@sha256:887a259a5a534f3c4f36cb02dca341673c6089431057242cdc931e9f133147e9 # ratchet:docker://rhysd/actionlint:1.7.7 + - uses: docker://index.docker.io/rhysd/actionlint@sha256:b1934ee5f1c509618f2508e6eb47ee0d3520686341fec936f3b79331f9315667 # ratchet:docker://rhysd/actionlint:1.7.12 with: args: -color diff --git a/.github/workflows/ratchet.yml b/.github/workflows/ratchet.yml index 782a584..fe4d3a8 100644 --- a/.github/workflows/ratchet.yml +++ b/.github/workflows/ratchet.yml @@ -6,7 +6,7 @@ jobs: ratchet: runs-on: ubuntu-latest steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6 - name: Ratchet Lint uses: sethvargo/ratchet@27f7515b4648e179168f8f8ae2257636fdb03c48 # ratchet:sethvargo/ratchet@main diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index dcb0a9f..3a933d3 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -9,7 +9,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6 with: show-progress: false From 675194e641e466de444602153b371a909828b7ba Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Sun, 5 Apr 2026 00:51:33 -0400 Subject: [PATCH 06/12] ratchet.yml: fix --- .github/workflows/ratchet.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ratchet.yml b/.github/workflows/ratchet.yml index fe4d3a8..5b9ec11 100644 --- a/.github/workflows/ratchet.yml +++ b/.github/workflows/ratchet.yml @@ -7,8 +7,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6 + with: + show-progress: false + sparse-checkout: '.github/' - name: Ratchet Lint uses: sethvargo/ratchet@27f7515b4648e179168f8f8ae2257636fdb03c48 # ratchet:sethvargo/ratchet@main with: - args: lint .github/workflows + args: lint .github/workflows/*.yml From cf54d342fc5693967cc5168068b928f7a081bff5 Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Sun, 5 Apr 2026 00:52:21 -0400 Subject: [PATCH 07/12] only trigger on prs --- .github/workflows/actionlint.yml | 1 - .github/workflows/ratchet.yml | 1 - .github/workflows/rust.yml | 1 - 3 files changed, 3 deletions(-) diff --git a/.github/workflows/actionlint.yml b/.github/workflows/actionlint.yml index 9aa8794..8a8f1d4 100644 --- a/.github/workflows/actionlint.yml +++ b/.github/workflows/actionlint.yml @@ -1,5 +1,4 @@ on: - push: pull_request: jobs: diff --git a/.github/workflows/ratchet.yml b/.github/workflows/ratchet.yml index 5b9ec11..50b26d0 100644 --- a/.github/workflows/ratchet.yml +++ b/.github/workflows/ratchet.yml @@ -1,5 +1,4 @@ on: - push: pull_request: jobs: diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 3a933d3..311e0dd 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,5 +1,4 @@ on: - push: pull_request: env: From 0ef2cdf9df193c2570b2753f50d39ffbc731ca9d Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Sun, 5 Apr 2026 00:56:27 -0400 Subject: [PATCH 08/12] fix rutt-tui/src/main.rs --- rutt-tui/src/main.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rutt-tui/src/main.rs b/rutt-tui/src/main.rs index 1c63ac0..64c21e8 100644 --- a/rutt-tui/src/main.rs +++ b/rutt-tui/src/main.rs @@ -63,9 +63,9 @@ async fn run_app( ui(f, state); })?; - if event::poll(std::time::Duration::from_millis(16))? - && let Event::Key(key) = event::read()? - && key.kind == KeyEventKind::Press { + if event::poll(std::time::Duration::from_millis(16))? { + if let Event::Key(key) = event::read()? { + if key.kind == KeyEventKind::Press { let action = match key.code { KeyCode::Char('q') => Some(Action::Quit), KeyCode::Char('k') | KeyCode::Up => Some(Action::MoveUp), @@ -84,6 +84,8 @@ async fn run_app( state.handle_action(action, visible_height); } } + } + } } } From 9c015a5e1b8b5158514afbb88f54fd2e33f931f5 Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Sun, 5 Apr 2026 00:57:45 -0400 Subject: [PATCH 09/12] ratchet.yml: fix args --- .github/workflows/ratchet.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ratchet.yml b/.github/workflows/ratchet.yml index 50b26d0..2a5fd69 100644 --- a/.github/workflows/ratchet.yml +++ b/.github/workflows/ratchet.yml @@ -10,7 +10,7 @@ jobs: show-progress: false sparse-checkout: '.github/' - - name: Ratchet Lint + - name: ratchet uses: sethvargo/ratchet@27f7515b4648e179168f8f8ae2257636fdb03c48 # ratchet:sethvargo/ratchet@main with: - args: lint .github/workflows/*.yml + files: .github/workflows/*.yml From 6175b9585236957b8377e6c5dc44dee3cdb6b154 Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Sun, 5 Apr 2026 01:01:59 -0400 Subject: [PATCH 10/12] rust.yml: split up --- .github/workflows/rust.yml | 48 +++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 311e0dd..6e46fb3 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -14,17 +14,49 @@ jobs: - name: Install Rust toolchain uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # ratchet:dtolnay/rust-toolchain@stable + + - name: cargo build + run: cargo build --workspace --verbose + + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6 with: - components: rustfmt, clippy + show-progress: false - - name: Check format - run: cargo fmt --all -- --check + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # ratchet:dtolnay/rust-toolchain@stable + + - name: cargo test + run: cargo test --workspace --verbose + + clippy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6 + with: + show-progress: false + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # ratchet:dtolnay/rust-toolchain@stable + with: + components: clippy - - name: Lint with clippy + - name: cargo clippy run: cargo clippy --workspace --all-targets --all-features -- -D warnings - - name: Build - run: cargo build --workspace --verbose + fmt: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6 + with: + show-progress: false - - name: Run tests - run: cargo test --workspace --verbose + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # ratchet:dtolnay/rust-toolchain@stable + with: + components: rustfmt + + - name: cargo fmt + run: cargo fmt --all -- --check From aee908390b1db1b1a52e9e117c3b2a3308ca1e3d Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Sun, 5 Apr 2026 01:03:57 -0400 Subject: [PATCH 11/12] main.rs fix --- rutt-tui/src/main.rs | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/rutt-tui/src/main.rs b/rutt-tui/src/main.rs index 64c21e8..801876b 100644 --- a/rutt-tui/src/main.rs +++ b/rutt-tui/src/main.rs @@ -63,27 +63,24 @@ async fn run_app( ui(f, state); })?; - if event::poll(std::time::Duration::from_millis(16))? { - if let Event::Key(key) = event::read()? { - if key.kind == KeyEventKind::Press { - let action = match key.code { - KeyCode::Char('q') => Some(Action::Quit), - KeyCode::Char('k') | KeyCode::Up => Some(Action::MoveUp), - KeyCode::Char('j') | KeyCode::Down => Some(Action::MoveDown), - KeyCode::Enter | KeyCode::Char('l') | KeyCode::Right => Some(Action::Enter), - KeyCode::Backspace | KeyCode::Char('h') | KeyCode::Left => { - Some(Action::Back) - } - _ => None, - }; - - if let Some(action) = action { - if action == Action::Quit { - return Ok(()); - } - state.handle_action(action, visible_height); - } + if event::poll(std::time::Duration::from_millis(16))? + && let Event::Key(key) = event::read()? + && key.kind == KeyEventKind::Press + { + let action = match key.code { + KeyCode::Char('q') => Some(Action::Quit), + KeyCode::Char('k') | KeyCode::Up => Some(Action::MoveUp), + KeyCode::Char('j') | KeyCode::Down => Some(Action::MoveDown), + KeyCode::Enter | KeyCode::Char('l') | KeyCode::Right => Some(Action::Enter), + KeyCode::Backspace | KeyCode::Char('h') | KeyCode::Left => Some(Action::Back), + _ => None, + }; + + if let Some(action) = action { + if action == Action::Quit { + return Ok(()); } + state.handle_action(action, visible_height); } } } From a0b3b9db2b7e73e4fe9b0f372474c5605f2a4ec3 Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Sun, 5 Apr 2026 01:06:45 -0400 Subject: [PATCH 12/12] add names to yml files --- .github/workflows/actionlint.yml | 2 ++ .github/workflows/ratchet.yml | 2 ++ .github/workflows/rust.yml | 2 ++ 3 files changed, 6 insertions(+) diff --git a/.github/workflows/actionlint.yml b/.github/workflows/actionlint.yml index 8a8f1d4..95b6697 100644 --- a/.github/workflows/actionlint.yml +++ b/.github/workflows/actionlint.yml @@ -1,3 +1,5 @@ +name: actionlint + on: pull_request: diff --git a/.github/workflows/ratchet.yml b/.github/workflows/ratchet.yml index 2a5fd69..275736d 100644 --- a/.github/workflows/ratchet.yml +++ b/.github/workflows/ratchet.yml @@ -1,3 +1,5 @@ +name: ratchet + on: pull_request: diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 6e46fb3..270fe31 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,3 +1,5 @@ +name: rust + on: pull_request: