Skip to content

Commit

Permalink
build(image-io): add native pixi build-test configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
thewtex committed Sep 17, 2024
1 parent 057db0c commit d14679a
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
3 changes: 3 additions & 0 deletions itk_wasm_env.bash
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ export ITK_WASM_DOWNSAMPLE_TEST_DATA_URLS=${ITK_WASM_DOWNSAMPLE_TEST_DATA_URLS:-

export ITK_WASM_MESH_IO_TEST_DATA_HASH=${ITK_WASM_MESH_IO_TEST_DATA_HASH:-$(cat packages/mesh-io/package.json | jq -e -r '."itk-wasm"."test-data-hash"')}
export ITK_WASM_MESH_IO_TEST_DATA_URLS=${ITK_WASM_MESH_IO_TEST_DATA_URLS:-$(cat packages/mesh-io/package.json | jq -e -r '."itk-wasm"."test-data-urls" | join(" ")')}

export ITK_WASM_IMAGE_IO_TEST_DATA_HASH=${ITK_WASM_IMAGE_IO_TEST_DATA_HASH:-$(cat packages/image-io/package.json | jq -e -r '."itk-wasm"."test-data-hash"')}
export ITK_WASM_IMAGE_IO_TEST_DATA_URLS=${ITK_WASM_IMAGE_IO_TEST_DATA_URLS:-$(cat packages/image-io/package.json | jq -e -r '."itk-wasm"."test-data-urls" | join(" ")')}
5 changes: 5 additions & 0 deletions packages/image-io/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
"itk-wasm": {
"emscripten-docker-image": "itkwasm/emscripten:latest",
"wasi-docker-image": "itkwasm/wasi:latest",
"test-data-hash": "bafybeibyjhkcrinl2lotw5g2vngjs23aaenv3tjzxssm35jxaci5ylsqia",
"test-data-urls": [
"https://github.com/InsightSoftwareConsortium/ITK-Wasm/releases/download/itk-wasm-v1.0.0-b.155/image-io-test-data.tar.gz",
"https://w3s.link/ipfs/bafybeiewe4rankwwe7nw7qm2g3qclflhci2e53wthn3gukdlhbff64pua4/data.tar.gz"
],
"typescript-package-name": "@itk-wasm/image-io",
"python-package-name": "itkwasm-image-io",
"package-description": "Input and output for scientific and medical image file formats.",
Expand Down
27 changes: 27 additions & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ depends-on = ["pnpm-install"]
outputs = ["packages/mesh-io/test/data.tar.gz"]
description = "Download mesh-io test data"

[tasks.image-io-test-data-download]
cmd = "npx dam download test/data test/data.tar.gz $ITK_WASM_IMAGE_IO_TEST_DATA_HASH $ITK_WASM_IMAGE_IO_TEST_DATA_URLS"
cwd = "packages/image-io"
depends-on = ["pnpm-install"]
outputs = ["packages/image-io/test/data.tar.gz"]
description = "Download image-io test data"

[tasks.export-itk-wasm-env-vars]
cmd = "bash -c ./itk_wasm_env.bash && env | grep ITK_WASM | grep -v TEST > ./src/docker/itk-wasm-base/itk_wasm_env_vars.sh"
outputs = ["src/docker/itk-wasm-base/itk_wasm_env_vars.*"]
Expand Down Expand Up @@ -289,6 +296,26 @@ cmd = "ctest --test-dir $ITK_WASM_NATIVE_WORKSPACE/mesh-io-build"
depends-on = ["build-native-mesh-io"]
description = "Test mesh-io native binaries"

[feature.native.tasks.configure-native-image-io]
cmd = '''cmake -B$ITK_WASM_NATIVE_WORKSPACE/image-io-build -Spackages/image-io -GNinja
-DITK_DIR:PATH=$ITK_WASM_ITK_BUILD_DIR
-DBUILD_TESTING:BOOL=ON
-DCMAKE_CXX_STANDARD:STRING=20
-DCMAKE_BUILD_TYPE:STRING=Debug'''
depends-on = ["build-itk-wasm", "image-io-test-data-download"]
outputs = ["native/image-io-build/CMakeFiles/"]
description = "Configure image-io native binaries"

[feature.native.tasks.build-native-image-io]
cmd = "cmake --build $ITK_WASM_NATIVE_WORKSPACE/image-io-build"
depends-on = ["configure-native-image-io"]
description = "Build image-io native binaries"

[feature.native.tasks.test-native-image-io]
cmd = "ctest --test-dir $ITK_WASM_NATIVE_WORKSPACE/image-io-build"
depends-on = ["build-native-image-io"]
description = "Test image-io native binaries"

[feature.native.dependencies]
cmake = ">=3.30.2,<4"
cxx-compiler = ">=1.7.0,<2"
Expand Down

0 comments on commit d14679a

Please sign in to comment.