Missing rename FAST_MODULE_Dicom to DICOM #829
This file contains hidden or 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 is a basic workflow to help you get started with Actions | |
| name: CI Windows | |
| # Controls when the action will run. | |
| on: | |
| # Triggers the workflow on push or pull request events but only for the master branch | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| release: | |
| types: [ published ] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| env: | |
| # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
| BUILD_TYPE: Release | |
| jobs: | |
| build: | |
| runs-on: windows-2022 | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Install dependencies | |
| run: | | |
| pip3 install --upgrade pip | |
| pip3 install twine | |
| - name: Install CUDA | |
| shell: powershell | |
| run: | | |
| $CUDA_KNOWN_URLS = @{ | |
| "11.0.1" = "http://developer.download.nvidia.com/compute/cuda/11.0.1/network_installers/cuda_11.0.1_win10_network.exe"; | |
| "11.0.2" = "http://developer.download.nvidia.com/compute/cuda/11.0.2/network_installers/cuda_11.0.2_win10_network.exe"; | |
| "11.0.3" = "http://developer.download.nvidia.com/compute/cuda/11.0.3/network_installers/cuda_11.0.3_win10_network.exe"; | |
| "11.1.0" = "https://developer.download.nvidia.com/compute/cuda/11.1.0/network_installers/cuda_11.1.0_win10_network.exe"; | |
| "11.1.1" = "https://developer.download.nvidia.com/compute/cuda/11.1.1/network_installers/cuda_11.1.1_win10_network.exe"; | |
| "11.2.0" = "https://developer.download.nvidia.com/compute/cuda/11.2.0/network_installers/cuda_11.2.0_win10_network.exe"; | |
| "11.2.1" = "https://developer.download.nvidia.com/compute/cuda/11.2.1/network_installers/cuda_11.2.1_win10_network.exe"; | |
| "11.2.2" = "https://developer.download.nvidia.com/compute/cuda/11.2.2/network_installers/cuda_11.2.2_win10_network.exe"; | |
| "11.3.0" = "https://developer.download.nvidia.com/compute/cuda/11.3.0/network_installers/cuda_11.3.0_win10_network.exe" | |
| } | |
| $CUDA_PACKAGES_IN = @( | |
| "nvcc"; | |
| "cudart"; | |
| ) | |
| $CUDA_VERSION_FULL = "11.0.3" | |
| $CUDA_MAJOR=11 | |
| $CUDA_MINOR=0 | |
| $CUDA_PATCH=3 | |
| $CUDA_PACKAGES = "" | |
| Foreach ($package in $CUDA_PACKAGES_IN) { | |
| # Make sure the correct package name is used for nvcc. | |
| if($package -eq "nvcc" -and [version]$CUDA_VERSION_FULL -lt [version]"9.1"){ | |
| $package="compiler" | |
| } elseif($package -eq "compiler" -and [version]$CUDA_VERSION_FULL -ge [version]"9.1") { | |
| $package="nvcc" | |
| } | |
| $CUDA_PACKAGES += " $($package)_$($CUDA_MAJOR).$($CUDA_MINOR)" | |
| } | |
| echo "$($CUDA_PACKAGES)" | |
| $CUDA_REPO_PKG_REMOTE=$CUDA_KNOWN_URLS[$CUDA_VERSION_FULL] | |
| $CUDA_REPO_PKG_LOCAL="cuda_$($CUDA_VERSION_FULL)_win10_network.exe" | |
| Write-Output "Downloading CUDA Network Installer for $($CUDA_VERSION_FULL) from: $($CUDA_REPO_PKG_REMOTE)" | |
| Invoke-WebRequest $CUDA_REPO_PKG_REMOTE -OutFile $CUDA_REPO_PKG_LOCAL | Out-Null | |
| if(Test-Path -Path $CUDA_REPO_PKG_LOCAL){ | |
| Write-Output "Downloading Complete" | |
| } else { | |
| Write-Output "Error: Failed to download $($CUDA_REPO_PKG_LOCAL) from $($CUDA_REPO_PKG_REMOTE)" | |
| exit 1 | |
| } | |
| # Invoke silent install of CUDA (via network installer) | |
| Write-Output "Installing CUDA $($CUDA_VERSION_FULL). Subpackages $($CUDA_PACKAGES)" | |
| Start-Process -Wait -FilePath .\"$($CUDA_REPO_PKG_LOCAL)" -ArgumentList "-s $($CUDA_PACKAGES)" | |
| # Check the return status of the CUDA installer. | |
| if (!$?) { | |
| Write-Output "Error: CUDA installer reported error. $($LASTEXITCODE)" | |
| exit 1 | |
| } | |
| # Store the CUDA_PATH in the environment for the current session, to be forwarded in the action. | |
| $CUDA_PATH = "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v$($CUDA_MAJOR).$($CUDA_MINOR)" | |
| $CUDA_PATH_VX_Y = "CUDA_PATH_V$($CUDA_MAJOR)_$($CUDA_MINOR)" | |
| # Set environmental variables in this session | |
| $env:CUDA_PATH = "$($CUDA_PATH)" | |
| $env:CUDA_PATH_VX_Y = "$($CUDA_PATH_VX_Y)" | |
| Write-Output "CUDA_PATH $($CUDA_PATH)" | |
| Write-Output "CUDA_PATH_VX_Y $($CUDA_PATH_VX_Y)" | |
| - name: Download cuDNN and TensorRT | |
| uses: robinraju/release-downloader@main | |
| if: ${{ github.event_name != 'pull_request' }} | |
| with: | |
| repository: "smistad/FAST-secret-dependencies" | |
| latest: true | |
| fileName: "*" | |
| token: ${{ secrets.DOWNLOAD_SECRET_DEPENDENCIES }} | |
| - name: Install cuDNN and TensorRT | |
| if: ${{ github.event_name != 'pull_request' }} | |
| shell: powershell | |
| run: | | |
| Expand-Archive -Path ${{github.workspace}}/cudnn-windows-x86_64-8.6.0.163_cuda11-archive.zip -DestinationPath ${{github.workspace}}/cudnn/ | |
| cp ${{github.workspace}}/cudnn/cudnn-windows-x86_64-8.6.0.163_cuda11-archive/bin/*.dll "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.0/bin/" | |
| cp ${{github.workspace}}/cudnn/cudnn-windows-x86_64-8.6.0.163_cuda11-archive/include/cudnn*.h "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.0/include/" | |
| cp ${{github.workspace}}/cudnn/cudnn-windows-x86_64-8.6.0.163_cuda11-archive/lib/cudnn*.lib "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.0/lib/x64/" | |
| Expand-Archive -Path ${{github.workspace}}/TensorRT-8.5.3.1.Windows10.x86_64.cuda-11.8.cudnn8.6.zip -DestinationPath ${{github.workspace}}/trt/ | |
| - name: Configure CMake (with TensorRT) | |
| if: ${{ github.event_name != 'pull_request' }} | |
| # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. | |
| # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type | |
| run: | | |
| cmake ${{github.workspace}} -B ${{github.workspace}}/build ` | |
| -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ` | |
| -DFAST_MODULE_OpenVINO=ON ` | |
| -DFAST_MODULE_DICOM=ON ` | |
| -DFAST_MODULE_WholeSlideImaging=ON ` | |
| -DFAST_MODULE_OpenIGTLink=ON ` | |
| -DFAST_MODULE_Clarius=ON ` | |
| -DFAST_MODULE_TensorFlow=ON ` | |
| -DCUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.0/" ` | |
| -DTensorRT_ROOT="${{github.workspace}}/trt/TensorRT-8.5.3.1/" ` | |
| -DTensorRT_parsers_LIBRARY="${{github.workspace}}/trt/TensorRT-8.5.3.1/lib/nvparsers.lib" ` | |
| -DTensorRT_onnx_parser_LIBRARY="${{github.workspace}}/trt/TensorRT-8.5.3.1/lib/nvonnxparser.lib" ` | |
| -DFAST_MODULE_TensorRT=ON ` | |
| -DFAST_MODULE_HDF5=ON ` | |
| -DFAST_MODULE_Plotting=ON ` | |
| -DFAST_MODULE_Python=ON ` | |
| -DFAST_MODULE_RealSense=ON ` | |
| -DFAST_BUILD_EXAMPLES=ON | |
| - name: Configure CMake (without TensorRT) | |
| if: ${{ github.event_name == 'pull_request' }} | |
| # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. | |
| # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type | |
| run: | | |
| cmake -G "Visual Studio 17 2022" -T "v142" ${{github.workspace}} ` | |
| -B ${{github.workspace}}/build ` | |
| -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ` | |
| -DFAST_MODULE_OpenVINO=ON ` | |
| -DFAST_MODULE_DICOM=ON ` | |
| -DFAST_MODULE_WholeSlideImaging=ON ` | |
| -DFAST_MODULE_OpenIGTLink=ON ` | |
| -DFAST_MODULE_Clarius=ON ` | |
| -DFAST_MODULE_TensorFlow=ON ` | |
| -DFAST_MODULE_TensorRT=OFF ` | |
| -DFAST_MODULE_HDF5=ON ` | |
| -DFAST_MODULE_Plotting=ON ` | |
| -DFAST_MODULE_Python=ON ` | |
| -DFAST_MODULE_RealSense=ON ` | |
| -DFAST_BUILD_EXAMPLES=ON | |
| - name: Build | |
| # Build your program with the given configuration | |
| run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 4 | |
| - name: Build Python wheel | |
| run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target python-wheel -j 4 | |
| - name: Package | |
| run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target package -j 4 | |
| - name: Upload Windows installer | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Window installer | |
| path: ${{github.workspace}}/build/fast_*.exe | |
| if-no-files-found: error | |
| - name: Upload archive package | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Archive package (zip) | |
| path: ${{github.workspace}}/build/fast_*.zip | |
| if-no-files-found: error | |
| - name: Upload Python wheel | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Python wheel | |
| path: ${{github.workspace}}/build/python/dist/pyfast-*.whl | |
| if-no-files-found: error | |
| - name: Upload Windows installer to release | |
| if: ${{ github.event_name == 'release' }} | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: ${{github.workspace}}/build/fast_*.exe | |
| file_glob: true | |
| tag: ${{ github.ref }} | |
| overwrite: true | |
| - name: Upload archive package to release | |
| if: ${{ github.event_name == 'release' }} | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: ${{github.workspace}}/build/fast_*.zip | |
| file_glob: true | |
| tag: ${{ github.ref }} | |
| overwrite: true | |
| - name: Upload Python wheel to release | |
| if: ${{ github.event_name == 'release' }} | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: ${{github.workspace}}/build/python/dist/pyfast-*.whl | |
| file_glob: true | |
| tag: ${{ github.ref }} | |
| overwrite: true | |
| - name: Upload Python wheel to PyPi | |
| if: ${{ github.event_name == 'release' && !contains(github.ref, 'rc') }} | |
| run: | | |
| twine upload --username __token__ --password ${{ secrets.PYPI_API_TOKEN }} ${{github.workspace}}/build/python/dist/pyfast-*.whl | |
| test-python-wheel: | |
| name: Test Python Wheel | |
| needs: [build] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.6', '3.10', '3.12'] | |
| runs-on: windows-2022 | |
| steps: | |
| - name: Download wheel artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: 'Python wheel' | |
| path: ${{github.workspace}}/download/ | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Display Python version | |
| run: python -c "import sys; print(sys.version)" | |
| - name: Install wheel | |
| shell: powershell | |
| run: | | |
| cd ${{github.workspace}}/download/ | |
| Get-ChildItem -Path ".\*.whl" | ForEach-Object { python -m pip install $_.FullName } | |
| - name: Import FAST with Python | |
| shell: powershell | |
| run: | | |
| try { | |
| python -c "import fast" | |
| } catch { | |
| Write-Warning "Import failed" | |
| } | |
| exit 0 | |
| test-python: | |
| name: Run Python Tests | |
| needs: [build] | |
| runs-on: windows-2022 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.12 | |
| - name: Download wheel artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: 'Python wheel' | |
| path: ${{github.workspace}}/download/ | |
| - name: Display Python version | |
| run: python -c "import sys; print(sys.version)" | |
| - name: Install POCL | |
| shell: powershell | |
| run: | | |
| cd ${{github.workspace}}/download/ | |
| Write-Output "Downloading POCL .." | |
| Invoke-WebRequest https://github.com/pocl/pocl/releases/download/v7.0/PoCL-7.0.0-CONF-win64.exe -OutFile pocl_installer.exe | Out-Null | |
| if(Test-Path -Path pocl_installer.exe){ | |
| Write-Output "Downloading Complete" | |
| } else { | |
| Write-Output "Error: Failed to download POCL installer" | |
| exit 1 | |
| } | |
| Write-Output "Installing POCL .." | |
| Start-Process -Wait -FilePath .\pocl_installer.exe -ArgumentList "/S" | |
| - name: Install wheel | |
| shell: powershell | |
| run: | | |
| cd ${{github.workspace}}/download/ | |
| Get-ChildItem -Path ".\*.whl" | ForEach-Object { python -m pip install $_.FullName } | |
| - name: Cache test data | |
| id: cache-test-dataset | |
| uses: actions/cache@v4 | |
| with: | |
| path: C:/ProgramData/FAST/data/ | |
| key: test-dataset | |
| enableCrossOsArchive: true | |
| - name: Download test data | |
| run: | | |
| python -c "import fast;fast.downloadTestDataIfNotExists()" | |
| - name: Run tests | |
| run: | | |
| cd ${{github.workspace}} | |
| python -m pip install pytest numpy | |
| python -m pip install torch --index-url https://download.pytorch.org/whl/cpu | |
| pytest source/FAST/ -v -k 'not test_shortcuts' | |
| # Seg faults for some reason: | |
| # test-cpp: | |
| # name: Run C++ Tests | |
| # needs: [build] | |
| # runs-on: windows-2022 | |
| # steps: | |
| # - name: Download artifacts | |
| # uses: actions/download-artifact@v4 | |
| # with: | |
| # name: 'Archive package (zip)' | |
| # path: ${{github.workspace}}/download/ | |
| # - name: Extract artifact | |
| # run: | | |
| # Get-ChildItem -Path "${{github.workspace}}/download/" -Filter "*.zip" | ForEach-Object { | |
| # Expand-Archive -Path $_.FullName -DestinationPath ${{github.workspace}} | |
| # } | |
| # - name: Install POCL | |
| # shell: powershell | |
| # run: | | |
| # cd ${{github.workspace}}/download/ | |
| # Write-Output "Downloading POCL .." | |
| # Invoke-WebRequest https://github.com/pocl/pocl/releases/download/v7.0/PoCL-7.0.0-CONF-win64.exe -OutFile pocl_installer.exe | Out-Null | |
| # if(Test-Path -Path pocl_installer.exe){ | |
| # Write-Output "Downloading Complete" | |
| # } else { | |
| # Write-Output "Error: Failed to download POCL installer" | |
| # exit 1 | |
| # } | |
| # | |
| # Write-Output "Installing POCL .." | |
| # Start-Process -Wait -FilePath .\pocl_installer.exe -ArgumentList "/S" | |
| # - name: Cache test data | |
| # id: cache-test-dataset | |
| # uses: actions/cache@v4 | |
| # with: | |
| # path: C:/ProgramData/FAST/data/ | |
| # key: test-dataset | |
| # enableCrossOsArchive: true | |
| # - name: Download test data | |
| # run: | | |
| # cd ${{github.workspace}} | |
| # cd fast* | |
| # cd fast/bin/ | |
| # ./downloadTestData | |
| # - name: Run tests | |
| # run: | | |
| # cd ${{github.workspace}} | |
| # cd fast_* | |
| # cd fast/bin/ | |
| # ./testFAST ~[visual] |