Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ jobs:
cache: npm

# The Electron *package* is needed — `src/main` and `src/preload` are typed against
# it. The 100MB Electron *binary* is not: nothing here launches a window. The
# `drive:*` scripts do, and they want a macOS runner and a display, so they are not
# part of this workflow.
# it. The Electron *binary* is not needed in this job.
# The real Electron walkthrough runs with Xvfb in the bridge job below.
- name: Install
env:
ELECTRON_SKIP_BINARY_DOWNLOAD: "1"
Expand Down Expand Up @@ -87,6 +86,30 @@ jobs:
working-directory: brave-bot-ui
run: cargo test --all

# Reuse the compiled bridge for a credential-free, real Electron walkthrough.
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 24
cache: npm
cache-dependency-path: brave-bot-ui/package-lock.json

- name: Install desktop test dependencies
run: |
sudo apt-get update
sudo apt-get install -y xvfb libgtk-3-0 libnss3 libasound2t64

- name: Build desktop and run Node tests
working-directory: brave-bot-ui
run: |
npm ci
npm run build
node --test scripts/*.test.mjs

- name: Manual walkthrough regression
working-directory: brave-bot-ui
timeout-minutes: 5
run: xvfb-run -a node scripts/drive-manual-walkthrough.mjs

# Deliberately no `cargo fmt --all -- --check`, which the agent's own CI does run. The
# bridge crate is not rustfmt-clean: rustfmt would rewrite around 490 lines, mostly
# breaking method chains and `assert!` calls that are on one line on purpose. Adding
Expand Down
25 changes: 13 additions & 12 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions crates/bravebot-bridge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ bravebot-core = { path = "../../vendor/bravebot/crates/core" }
bravebot-tui = { path = "../../vendor/bravebot/crates/tui" }
serde = { workspace = true }
serde_json = { workspace = true }

[dev-dependencies]
tempfile = "3"
8 changes: 7 additions & 1 deletion crates/bravebot-bridge/src/bin/bravebot-rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ use std::sync::{Arc, Mutex};

fn main() {
let mut args = std::env::args().skip(1);
let mut settings = None;
if let Some(flag) = args.next() {
match flag.as_str() {
"--settings" => {
let Some(path) = args.next() else { eprintln!("--settings requires a file path"); std::process::exit(2); };
if args.next().is_some() { eprintln!("unexpected arguments after settings file"); std::process::exit(2); }
settings = Some(std::path::PathBuf::from(path));
}
"--version" | "-V" => {
println!("bravebot-rpc {} (agent {})", env!("CARGO_PKG_VERSION"), bravebot_bridge::agent_build());
return;
Expand All @@ -38,7 +44,7 @@ fn main() {
let emitter = Arc::clone(&out);
let mut bridge = Bridge::new(Box::new(move |event: Event| {
write_line(&emitter, &event.to_value());
}));
})).with_settings(settings);

bridge.ready();

Expand Down
Loading
Loading