Skip to content

Commit

Permalink
fix(libvnc-sys): initialize submodule in ci workflow & use pkg as def…
Browse files Browse the repository at this point in the history
…ault in libvnc-sys
  • Loading branch information
Chiichen committed May 10, 2024
1 parent 25bddd9 commit fb86b50
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ jobs:
- uses: actions/checkout@v4
- name: Install Rust nightly
run : rustup update nightly
- name: Init Submodule
run: git submodule init & git submodule update
- name: Build
run: cargo build -p libvnc-sys --no-default-features --features "source" --verbose
run: cargo build -p libvnc-sys --features "source" --verbose
- name: Test
run: cargo test -p libvnc-sys --no-default-features --features "source" --verbose
run: cargo test -p libvnc-sys --features "source" --verbose
2 changes: 2 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
run: sudo apt-get install libvncserver-dev
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Init Submodule
run: git submodule init & git submodule update
- name: Generate code coverage
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
- name: Upload coverage to Codecov
Expand Down
13 changes: 11 additions & 2 deletions examples/image_capture/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,16 @@ fn test_image() {
*pixel = image::Rgb([data[0], i as u8, data[2]]);
}
}

let output_path = current_dir().unwrap().join("image_output");
if !output_path.exists() {
if let Err(e) = create_dir(&output_path) {
error!(
"Faild to create output dir {} with error {}",
output_path.display(),
e
);
}
}
// Save the image as “fractal.png”, the format is deduced from the path
imgbuf.save("fractal.png").unwrap();
imgbuf.save(output_path.join("fractal.png")).unwrap();
}
3 changes: 1 addition & 2 deletions libvnc-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@ pkg-config = "0.3.30"
cmake = "0.1.50"

[features]
default = ["pkg"]
default = []
source = []
pkg = []

0 comments on commit fb86b50

Please sign in to comment.