Skip to content

Commit

Permalink
ci: Install zsh, fish and elvish on ubuntu-lastest for the `tes…
Browse files Browse the repository at this point in the history
…t` and `test_gitoxide` jobs
  • Loading branch information
shannmu committed Sep 10, 2024
1 parent 84caa83 commit 40cfe93
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,13 @@ jobs:
- run: rustup target add ${{ matrix.other }}
- run: rustup component add rustc-dev llvm-tools-preview rust-docs
if: startsWith(matrix.rust, 'nightly')
# Install fish, zsh, and elvish only on Ubuntu systems
- name: Install fish, zsh, and elvish on Ubuntu
run: sudo apt update -y && sudo apt install fish zsh elvish -y
if: matrix.os == 'ubuntu-latest'
- name: Install fish, elvish on macOS
run: brew install fish elvish
if: matrix.os == 'macos-14' || matrix.os == 'macos-13'
- run: sudo apt update -y && sudo apt install lldb gcc-multilib libsecret-1-0 libsecret-1-dev -y
if: matrix.os == 'ubuntu-latest'
- run: rustup component add rustfmt || echo "rustfmt not available"
Expand Down Expand Up @@ -227,6 +234,7 @@ jobs:
- run: rustup update --no-self-update stable && rustup default stable
- run: rustup target add i686-unknown-linux-gnu
- run: sudo apt update -y && sudo apt install gcc-multilib libsecret-1-0 libsecret-1-dev -y
- run: sudo apt update -y && sudo apt install fish zsh elvish -y
- run: rustup component add rustfmt || echo "rustfmt not available"
- run: cargo test -p cargo
env:
Expand Down
12 changes: 11 additions & 1 deletion tests/testsuite/shell_completions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ use snapbox::assert_data_eq;

#[cargo_test]
fn bash() {
// HACK: At least on CI, bash is not working on macOS
if cfg!(target_os = "macos") {
return;
}

let input = "cargo \t\t";
let expected = snapbox::str![
"%
Expand All @@ -26,10 +31,15 @@ fn bash() {

#[cargo_test]
fn elvish() {
// HACK: At least on CI, elvish is not working on macOS
if cfg!(target_os = "macos") {
return;
}

let input = "cargo \t\t";
let expected = snapbox::str![
"% cargo --config
_COMPLETING argument
COMPLETING argument
--color --version check install read-manifest update
--config -C clean locate-project remove vendor
--explain -V config login report verify-project
Expand Down

0 comments on commit 40cfe93

Please sign in to comment.