Skip to content

Commit

Permalink
ci: Run tests for feature openslide4
Browse files Browse the repository at this point in the history
  • Loading branch information
AzHicham committed Dec 10, 2023
1 parent 53fd628 commit 0081c80
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ env:

jobs:
benchmarks:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: make install-deps-apt
run: make install-deps-ubuntu-openslide4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: make install-deps-apt
run: make install-deps-ubuntu-openslide3
- name: Install latest nightly
uses: dtolnay/rust-toolchain@stable
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ env:

jobs:
coverage:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: make install-deps-apt
run: make install-deps-ubuntu-openslide4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}
Expand All @@ -35,7 +35,7 @@ jobs:
rustup component add llvm-tools-preview
cargo install cargo-llvm-cov
cargo llvm-cov clean --workspace # remove artifacts that may affect the coverage results
cargo llvm-cov --no-report --workspace --features deepzoom
cargo llvm-cov --no-report --workspace --features deepzoom,openslide4
cargo llvm-cov --no-run --workspace --lcov --output-path lcov.info
- uses: codecov/codecov-action@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
with:
toolchain: ${{ env.RUST_VERSION }}
- name: Install dependencies ubuntu
run: make install-deps-apt
run: make install-deps-ubuntu-openslide3
- uses: katyo/publish-crates@v2
with:
dry-run: ${{ github.event_name != 'release' }}
Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ "ubuntu-22.04", "ubuntu-20.04", "macos-12" ]
feature: [ "--no-default-features", "--features deepzoom", "--features image" ]
os: [ "ubuntu-22.04", "macos-12" ]
feature: [ "--no-default-features", "--features deepzoom", "--features openslide4" ]

env:
INSTALL_DEPS_CMD: install-deps-${{ contains(matrix.os, 'ubuntu') && 'ubuntu' || 'macos' }}-${{ contains(matrix.feature, 'openslide4') && 'openslide4' || 'openslide3' }}

steps:
- uses: actions/checkout@v4
Expand All @@ -41,12 +44,8 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}-${{ matrix.feature }}
- name: Install dependencies ubuntu
if: ${{ matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04' }}
run: make install-deps-apt
- name: Install dependencies macos
if: ${{ matrix.os == 'macos-12' }}
run: make install-deps-brew
- name: Install dependencies
run: make ${{ env.INSTALL_DEPS_CMD }}
- name: Build & Test (Debug)
run: cargo test --workspace ${{ matrix.feature }}
- name: Build & Test (Release)
Expand All @@ -61,7 +60,7 @@ jobs:
toolchain: ${{ env.RUST_VERSION }}
components: clippy, rustfmt
- name: Install dependencies ubuntu
run: make install-deps-apt
run: make install-deps-ubuntu-openslide3
- name: Generate Doc
env:
DOCS_RS: 1
Expand Down
22 changes: 17 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
.PHONY: install-deps-brew install-deps-apt dl-test-images
.PHONY: install-deps-macos-openslide3 install-deps-macos-openslide4 install-deps-ubuntu-openslide3 install-deps-ubuntu-openslide4 dl-test-images

install-deps-brew:
brew install openslide
install-deps-macos-openslide3:
curl https://raw.githubusercontent.com/Homebrew/homebrew-core/e6e41a54ec4d05000c1b95e515c85adb6f8f35af/Formula/o/openslide.rb > openslide.rb
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install openslide.rb

install-deps-apt:
install-deps-macos-openslide4:
curl https://raw.githubusercontent.com/Homebrew/homebrew-core/f92e0a24754ed265ff7a032b89b336dd612e5559/Formula/o/openslide.rb > openslide.rb
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install openslide.rb

install-deps-ubuntu-openslide3:
sudo apt-get update
sudo apt-get install -y --no-install-recommends libopenslide-dev=3.*

install-deps-ubuntu-openslide4:
sudo apt-get update
sudo apt install -y --no-install-recommends software-properties-common gnupg
sudo add-apt-repository -y ppa:openslide/openslide
sudo apt-get update
sudo apt-get install -y --no-install-recommends libopenslide-dev
sudo apt install -y --no-install-recommends libopenslide-dev=4.* libdicom-dev=1.* libwebp-dev=1.*

dl-test-images:
mkdir ./tests/assets/hamamatsu ./tests/assets/trestle ./tests/assets/mirax
Expand Down

1 comment on commit 0081c80

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

openslide-rs Benchmark

Benchmark suite Current: 0081c80 Previous: f3bc6b2 Ratio
deepzoom_read_image_256 1153937 ns/iter (± 9906) 1172414 ns/iter (± 53984) 0.98
deepzoom_read_image_256_arc 1152464 ns/iter (± 9204) 1170907 ns/iter (± 6596) 0.98
deepzoom_read_image_256_recreate_dz 1154482 ns/iter (± 9254) 1172927 ns/iter (± 5100) 0.98
deepzoom_read_image_512 4602861 ns/iter (± 123428) 4701048 ns/iter (± 641200) 0.98
deepzoom_read_image_512_arc 4604557 ns/iter (± 70764) 4697921 ns/iter (± 86807) 0.98
deepzoom_read_image_512_recreate_dz 4641753 ns/iter (± 173647) 4704266 ns/iter (± 345988) 0.99
openslide_read_image_256 1121450 ns/iter (± 9544) 1135185 ns/iter (± 9752) 0.99
openslide_read_image_512 4628834 ns/iter (± 117231) 4708386 ns/iter (± 18620) 0.98
openslide_read_region_256 1065090 ns/iter (± 6943) 1084811 ns/iter (± 6003) 0.98
openslide_read_region_512 4397764 ns/iter (± 28181) 4504716 ns/iter (± 23044) 0.98

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.