Skip to content

Commit

Permalink
ci: fix failing clipboard test pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
rootCircle committed Oct 3, 2024
1 parent 8342f1a commit 4fb1331
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ jobs:
- uses: actions/checkout@v4
- name: Install the Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Build cpast
run: cargo build -p cpast --no-default-features --verbose
- name: Build exclude cpast
run: cargo build --workspace --exclude cpast --all-features --all-targets
- name: Build
run: cargo build --workspace --all-features --all-targets


lint:
Expand All @@ -30,10 +28,8 @@ jobs:
- uses: actions/checkout@v4
- name: Install the Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Clippy cpast
run: cargo clippy -p cpast --no-default-features -- -D warnings
- name: Clippy exclude cpast
run: cargo clippy --workspace --exclude cpast --all-features --all-targets -- -D warnings
run: cargo clippy --workspace --all-features --all-targets -- -D warnings

format:
name: Format
Expand All @@ -53,7 +49,7 @@ jobs:
- name: Install the Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Run tests
run: cargo test --all-features --all-targets -- --skip send_to_clipboard_works
run: cargo test --all-features --all-targets

coverage:
name: Code coverage
Expand Down
5 changes: 5 additions & 0 deletions cpast/tests/clipboard_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
fn send_to_clipboard_works() {
use cli_clipboard::{ClipboardContext, ClipboardProvider};
let ctx = ClipboardContext::new();
if let Err(e) = ctx {
eprintln!("Error: {:?}", e);
return; // Skip the test as in no display env as in CI runners
}

let mut ctx = ctx.unwrap();
let the_string = "Hello, world!";
ctx.set_contents(the_string.to_owned()).unwrap();
Expand Down

0 comments on commit 4fb1331

Please sign in to comment.