yaml syntax fixes #118
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
name: Windows Build | |
on: | |
push: | |
branches: [ dev, itk_update ] | |
tags: | |
- v* | |
pull_request: | |
branches: [ dev ] | |
workflow_dispatch: | |
jobs: | |
build_and_test: | |
name: Build, test and upload | |
strategy: | |
max-parallel: 1 | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
runs-on: windows-2022 | |
if: ${{ startsWith(github.ref, 'refs/tags') || !contains(github.event.head_commit.message, '[skip ci]') }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Checkout submodules | |
run: | | |
git submodule init | |
git submodule update | |
- name: Build zlib | |
run: | | |
git clone https://github.com/madler/zlib.git | |
md zlib-build | |
cd zlib-build | |
cmake ..\zlib -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="..\zlib-install" | |
cmake --build . --config Release --target install | |
cd .. | |
dir | |
- name: Build ITK | |
run: | | |
md ITK-build | |
cd ITK-build | |
cmake.exe -G "Visual Studio 17 2022" -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Release ..\ITK | |
cmake --build . --config Release --target Install | |
cd .. | |
shell: cmd | |
- name: Build and test samseg python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: 'x64' | |
- run: | | |
python -m pip wheel . -w .\dist --no-deps | |
python -m pip install . -f .\dist\ | |
#python -m pip install -r requirements.txt | |
#python -m pip install pytest | |
#python -m pip install tensorflow | |
cd .. | |
python -c 'import samseg' | |
# python -m pytest samseg\samseg\tests | |
rm samseg\gems\*.pyd | |
rm samseg\gems\Release\*.pyd | |
env: | |
ZLIB_INCLUDE_DIR: .\zlib-install\include | |
ZLIB_LIBRARY: .\zlib-install\lib\zlibstatic.lib | |
ITK_DIR: ITK-build | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: windows-wheels | |
path: .\dist\*.whl | |
- name: Upload to PyPI | |
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }} | |
run: | | |
python -m pip install twine | |
python -m twine upload .\dist\*.whl -u __token__ -p "$env:PASSWORD" | |
env: | |
PASSWORD: ${{ secrets.PYPI_TOKEN }} |