-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #115 from thewtex/wasm
ENH: Add wasm configuration
- Loading branch information
Showing
21 changed files
with
3,602 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
name: Documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
build-wasm-documentation: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Free Disk Space (Ubuntu) | ||
uses: jlumbroso/free-disk-space@main | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Install | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
run_install: true | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Build | ||
run: | | ||
pnpm build | ||
- name: Build package typescript documentation | ||
run: | | ||
mkdir -p docs/ts/docs | ||
mkdir -p docs//ts/app | ||
sed "s% basePath:.*% basePath: '/ITKMorphologicalContourInterpolation/ts/docs',%" wasm/typescript/index.html > docs/ts/docs/index.html | ||
cp wasm/typescript/README.md docs/ts/docs/ | ||
mkdir -p docs/ts/docs/test/browser/demo-app | ||
cp wasm/typescript/test/browser/demo-app/logo.svg docs/ts/docs/test/browser/demo-app/ | ||
pushd wasm/typescript | ||
rm -rf demo-app node_modules/.vite | ||
export VITE_BASE_URL="/ITKMorphologicalContourInterpolation/ts/app/" | ||
pnpm build | ||
popd | ||
rsync -a wasm/typescript/demo-app/ docs/ts/app/ | ||
- name: Build package python documentation | ||
run: | | ||
mkdir -p docs/py/docs | ||
mkdir -p docs/py/app | ||
export SPHINX_BASE_URL="/ITKMorphologicalContourInterpolation/py/docs/" | ||
pushd wasm/python/itkwasm-morphological-contour-interpolation/docs | ||
pip install -r requirements.txt | ||
make html | ||
popd | ||
rsync -a wasm/python/itkwasm-morphological-contour-interpolation/docs/_build/html/ docs/py/docs/ | ||
- name: Upload Pages artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: docs | ||
retention-days: 7 | ||
|
||
deploy-gh-pages: | ||
needs: build-wasm-documentation | ||
runs-on: ubuntu-22.04 | ||
|
||
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | ||
permissions: | ||
contents: read | ||
pages: write # to deploy to Pages | ||
id-token: write # to verify the deployment originates from an appropriate source | ||
|
||
# Deploy to the github-pages environment | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
|
||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 | ||
# with: | ||
# preview: true <-> currently not available to the public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: WebAssembly | ||
|
||
on: [push,pull_request] | ||
|
||
jobs: | ||
build-wasm: | ||
name: "Build WebAssembly" | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Free Disk Space (Ubuntu) | ||
uses: jlumbroso/free-disk-space@main | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Install | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
run_install: true | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Build | ||
run: | | ||
pnpm build | ||
- name: Test | ||
run: | | ||
pnpm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,6 @@ | |
*.exe | ||
*.out | ||
*.app | ||
|
||
# wasm build | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: morphological-contour-interpolation | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
- pytest | ||
- python=3.11 | ||
- pip | ||
- pip: | ||
- hatch | ||
- itkwasm-image-io |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"name": "@itk-wasm/morphological-contour-interpolation-build", | ||
"version": "1.0.0", | ||
"description": "npm scripts to generate itk-wasm artifacts.", | ||
"private": true, | ||
"type": "module", | ||
"itk-wasm": { | ||
"typescript-package-name": "@itk-wasm/morphological-contour-interpolation", | ||
"typescript-output-dir": "wasm/typescript", | ||
"python-package-name": "itkwasm-morphological-contour-interpolation", | ||
"python-output-dir": "wasm/python", | ||
"package-description": "Morphology-based approach for interslice interpolation of anatomical slices from volumetric images.", | ||
"repository": "https://github.com/KitwareMedical/ITKMorphologicalContourInterpolation" | ||
}, | ||
"scripts": { | ||
"build": "pnpm build:gen:typescript && pnpm -r build && pnpm build:gen:python", | ||
"build:emscripten": "itk-wasm pnpm-script build:emscripten", | ||
"build:emscripten:debug": "itk-wasm pnpm-script build:emscripten:debug", | ||
"build:wasi": "itk-wasm pnpm-script build:wasi", | ||
"build:wasi:debug": "itk-wasm pnpm-script build:wasi:debug", | ||
"build:python:wasi": "itk-wasm pnpm-script build:python:wasi", | ||
"bindgen:typescript": "itk-wasm pnpm-script bindgen:typescript", | ||
"bindgen:python": "itk-wasm pnpm-script bindgen:python", | ||
"build:gen:typescript": "itk-wasm pnpm-script build:gen:typescript", | ||
"build:gen:python": "itk-wasm pnpm-script build:gen:python", | ||
"build:micromamba": "itk-wasm pnpm-script build:micromamba", | ||
"build:python:versionSync": "itk-wasm pnpm-script build:python:versionSync", | ||
"publish:python": "itk-wasm pnpm-script publish:python", | ||
"test": "pnpm test:data:download && pnpm -r test && pnpm test:python", | ||
"test:data:download": "echo \"not needed\"", | ||
"test:data:pack": "dam pack test/data test/data.tar.gz", | ||
"test:python:wasi": "itk-wasm pnpm-script test:python:wasi", | ||
"test:python:emscripten": "itk-wasm pnpm-script test:python:emscripten", | ||
"test:python:dispatch": "itk-wasm pnpm-script test:python:dispatch", | ||
"test:python": "itk-wasm pnpm-script test:python", | ||
"test:wasi": "itk-wasm pnpm-script test:wasi -- -V", | ||
"clean": "git clean -fdx -e node_modules" | ||
}, | ||
"license": "Apache-2.0", | ||
"devDependencies": { | ||
"@itk-wasm/dam": "^1.1.0", | ||
"@thewtex/setup-micromamba": "^1.9.7", | ||
"itk-wasm": "^1.0.0-b.166" | ||
} | ||
} |
Oops, something went wrong.