Skip to content
Open
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
11 changes: 11 additions & 0 deletions .github/workflows/hosts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ on:
- "Cargo.lock"
- "rust-toolchain.toml"
- ".github/workflows/hosts.yml"
# The same paths as a push: a pull request is tested the same way.
pull_request:
paths:
- "crates/shellrs-hosts/**"
# The cores it builds on.
- "crates/shellrs-ssh/**"
- "crates/shellrs-sync/**"
- "Cargo.toml"
- "Cargo.lock"
- "rust-toolchain.toml"
- ".github/workflows/hosts.yml"
workflow_dispatch:

jobs:
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/mobile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@ on:
- "Cargo.lock"
- "rust-toolchain.toml"
- ".github/workflows/mobile.yml"
# The same paths as a push: a pull request is tested the same way.
pull_request:
paths:
- "crates/shellrs-mobile/**"
- "crates/shellrs-ssh/**"
- "crates/shellrs-hosts/**"
- "crates/shellrs-sync/**"
- "scripts/build-ios.sh"
- "scripts/build-android.sh"
- "Cargo.toml"
- "Cargo.lock"
- "rust-toolchain.toml"
- ".github/workflows/mobile.yml"
workflow_dispatch:

jobs:
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/shells.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ on:
- "Cargo.lock"
- "rust-toolchain.toml"
- ".github/workflows/shells.yml"
# The same paths as a push: a pull request is tested the same way.
pull_request:
paths:
- "src/terminal/**"
- "src/testing.rs"
- "Cargo.toml"
- "Cargo.lock"
- "rust-toolchain.toml"
- ".github/workflows/shells.yml"
workflow_dispatch:

jobs:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/ssh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ on:
- "Cargo.lock"
- "rust-toolchain.toml"
- ".github/workflows/ssh.yml"
# The same paths as a push: a pull request is tested the same way.
pull_request:
paths:
- "crates/shellrs-ssh/**"
- "Cargo.toml"
- "Cargo.lock"
- "rust-toolchain.toml"
- ".github/workflows/ssh.yml"
workflow_dispatch:

jobs:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ on:
- "Cargo.lock"
- "rust-toolchain.toml"
- ".github/workflows/sync.yml"
# The same paths as a push: a pull request is tested the same way.
pull_request:
paths:
- "crates/shellrs-sync/**"
- "Cargo.toml"
- "Cargo.lock"
- "rust-toolchain.toml"
- ".github/workflows/sync.yml"
workflow_dispatch:

jobs:
Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# The app's own tests, as a pull request sees them: formatting, clippy
# over the whole workspace, the unit tests of every default member, the
# UI tests and the external CLI's.
#
# The other workflows answer to the paths they name and used to answer
# only to a push, so a pull request came back with no check at all; they
# now answer to a pull request too. This one carries the tests the others
# run only in parts: `shells` runs two groups of `terminal::`, `windows`
# runs a list of targets on Windows, and nothing ran the unit tests of
# the app or the UI tests as a whole on Linux.
#
# One UI test is skipped: projects::a_programs_title_names_the_terminal
# _until_it_is_named_by_hand does not close its dialog in time on Linux
# on main itself, change or no change, so it would fail every run until
# it is fixed.
name: tests

on:
push:
branches: ["**"]
paths:
- "src/**"
- "tests/**"
- "locales/**"
- "crates/**"
- "build.rs"
- "Cargo.toml"
- "Cargo.lock"
- "rust-toolchain.toml"
- ".cargo/**"
- ".github/workflows/tests.yml"
pull_request:
paths:
- "src/**"
- "tests/**"
- "locales/**"
- "crates/**"
- "build.rs"
- "Cargo.toml"
- "Cargo.lock"
- "rust-toolchain.toml"
- ".cargo/**"
- ".github/workflows/tests.yml"
workflow_dispatch:

jobs:
tests:
# The same image and packages shells.yml builds the app with.
runs-on: ubuntu-22.04
timeout-minutes: 90
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v4
- name: Dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake clang pkg-config libfontconfig-dev \
libfreetype-dev libxkbcommon-dev libxkbcommon-x11-dev libwayland-dev \
libx11-xcb-dev libxcb1-dev libvulkan-dev libdbus-1-dev libssl-dev
# rust-toolchain.toml picks the toolchain; this installs it with the
# components it lists before the cache key is computed.
- run: rustup toolchain install
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --check
- run: cargo clippy --all-targets -- -D warnings
- run: cargo test --locked --lib
# See the header: this one test does not close its dialog in time on
# Linux on main itself.
- run: cargo test --locked --test ui -- --skip projects::a_programs_title_names_the_terminal_until_it_is_named_by_hand
- run: cargo test --locked --test cli_bin
46 changes: 46 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,52 @@ on:
- "Cargo.toml"
- "Cargo.lock"
- "rust-toolchain.toml"
# The same paths as a push: a pull request is tested the same way.
pull_request:
paths:
- "src/cli/**"
- "src/analytics/**"
- "src/update/**"
- "src/app/mod.rs"
- "src/app/paths.rs"
- "src/app/computer.rs"
- "crates/shellrs-hosts/Cargo.toml"
- "crates/shellrs-hosts/src/private_key.rs"
- "src/app/window_hiding.rs"
- "src/app/system_hotkey.rs"
- "src/main.rs"
- "src/bin/**"
- "crates/shellrs-ssh/Cargo.toml"
- "crates/shellrs-ssh/src/connection.rs"
- "crates/shellrs-ssh/src/probe.rs"
- "src/ssh/transport.rs"
- "tests/ui/connection.rs"
- "crates/shellrs-ssh/src/sftp/download.rs"
- "crates/shellrs-ssh/src/sftp/journal.rs"
- "crates/shellrs-ssh/src/sftp/model.rs"
- "crates/shellrs-ssh/src/sftp/upload.rs"
- "crates/shellrs-ssh/src/sftp/sync.rs"
- "crates/shellrs-ssh/src/sftp/tests.rs"
- "src/sftp/local.rs"
- "src/credential/credential_dialog.rs"
- "src/settings/model.rs"
- "src/settings/settings_panel.rs"
- "src/terminal/local_shell.rs"
- "src/terminal/local_pty.rs"
- "src/project/project_panel.rs"
- "src/terminal/zmodem.rs"
- "src/serial/**"
- "crates/shellrs-sync/**"
- "src/app/shortcuts.rs"
- "src/workspace/window_state.rs"
- "src/testing.rs"
- "tests/cli_bin.rs"
- "build.rs"
- ".cargo/config.toml"
- "scripts/windows-runtime.ps1"
- "Cargo.toml"
- "Cargo.lock"
- "rust-toolchain.toml"
workflow_dispatch:

jobs:
Expand Down
4 changes: 4 additions & 0 deletions crates/shellrs-mobile/src/terminal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ async fn pump(
},
}
};
// The commands close before the events go out: what reads the end
// finds the terminal already refusing what it types, rather than a
// channel still open for a write nothing will carry.
commands.close();
output.finish(end);
}

Expand Down
6 changes: 4 additions & 2 deletions src/terminal/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1379,11 +1379,13 @@ impl Parser {
.commands
.send(TerminalTransportCommand::WriteData(wire));
}
// The flag before the ask: what reads it must find the transfer
// already on, not the two apart with the ask in between.
self.transferring
.store(self.zmodem.active(), Ordering::Release);
if let Some(direction) = ask {
self.proxy.send(TerminalUiEventKind::ZmodemAsk(direction));
}
self.transferring
.store(self.zmodem.active(), Ordering::Release);
}

/// Output for the emulator, and for what reads it beside: 关键字高亮,
Expand Down
8 changes: 6 additions & 2 deletions src/tmux/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,9 +458,13 @@ $3:0:1:my job:/home/alice
assert_eq!(read.current.as_deref(), Some("$1"), "{output}");
assert_eq!(read.names(), ["test", "work"]);

// No tmux.
// No tmux: only this directory on PATH, or a tmux the machine
// happens to have (the CI images ship one) would answer instead.
std::fs::remove_file(bin.join("tmux")).unwrap();
let output = crate::testing::sh(script(&command()), Some(&path));
// `sh` is looked up in the PATH the test sets, so it needs one here.
std::os::unix::fs::symlink("/bin/sh", bin.join("sh")).unwrap();
let only = bin.display().to_string();
let output = crate::testing::sh(script(&command()), Some(&only));
assert_eq!(String::from_utf8(output.stdout).unwrap(), "@@missing\n");
}
}
Loading