v4.15.1 #453
Workflow file for this run
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
| name: CI macOS 15 x86_64 | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| release: | |
| types: [ published ] | |
| workflow_dispatch: | |
| env: | |
| BUILD_TYPE: Release | |
| MACOSX_DEPLOYMENT_TARGET: 10.13 | |
| jobs: | |
| build: | |
| runs-on: macos-15-intel | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Install dependencies | |
| run: | | |
| brew install pcre # Needed by SWIG | |
| - name: Setup pyenv | |
| env: | |
| ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
| MACOSX_DEPLOYMENT_TARGET: 10.13 | |
| PYTHON_CONFIGURE_OPTS: "--enable-framework" | |
| CFLAGS: "-Wno-implicit-function-declaration" | |
| LDFLAGS: "-L/usr/local/opt/zlib/lib" | |
| CPPFLAGS: "-I/usr/local/opt/zlib/include" | |
| PKG_CONFIG_PATH: "/usr/local/opt/zlib/lib/pkgconfig" | |
| uses: "gabrielfalcao/pyenv-action@v18" | |
| with: | |
| default: 3.6.9 | |
| - name: Install pip dependencies | |
| run: | | |
| pip3 install --upgrade pip | |
| pip3 install twine wheel==0.37.1 | |
| - name: Configure CMake | |
| run: | | |
| cmake -B ${{github.workspace}}/build \ | |
| -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}\ | |
| -DCMAKE_OSX_ARCHITECTURES:STRING="x86_64" \ | |
| -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_HDF5=ON \ | |
| -DFAST_MODULE_Plotting=ON \ | |
| -DFAST_MODULE_Python=ON \ | |
| -DFAST_Python_Version="3.6" \ | |
| -DFAST_Python_Include="$(dirname $(pyenv which python))/../include/python3.6m/" \ | |
| -DFAST_Python_Library="$(dirname $(pyenv which python))/../lib/libpython3.6.dylib" \ | |
| -DFAST_MODULE_RealSense=OFF \ | |
| -DFAST_BUILD_EXAMPLES=ON | |
| - name: Build | |
| run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 4 | |
| - name: Build Python wheel | |
| env: | |
| MACOSX_DEPLOYMENT_TARGET: 10.13 | |
| 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 archive package | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Archive package (tar.xz) | |
| path: ${{github.workspace}}/build/fast_*.tar.xz | |
| 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 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_*.tar.xz | |
| 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.x'] | |
| runs-on: macos-15-intel | |
| 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: Create virtual environment and install wheel | |
| run: | | |
| cd ${{github.workspace}} | |
| python -m venv venv # Get error if not using virtual environment for some reason | |
| source venv/bin/activate | |
| python -m pip install ${{github.workspace}}/download/pyfast-*.whl | |
| - name: Import FAST with Python | |
| run: | | |
| cd ${{github.workspace}} | |
| source venv/bin/activate | |
| python -c "import fast" | |
| test-python: | |
| name: Run Python Tests | |
| needs: [build] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.10', '3.x'] | |
| runs-on: macos-15-intel | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - 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: Create virtual environment and install wheel | |
| run: | | |
| cd ${{github.workspace}} | |
| python -m venv venv # Get error if not using virtual environment for some reason | |
| source venv/bin/activate | |
| python -m pip install ${{github.workspace}}/download/pyfast-*.whl numpy pytest | |
| - name: Cache test data | |
| id: cache-test-dataset | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/FAST/data/ | |
| key: test-dataset | |
| enableCrossOsArchive: true | |
| - name: Download test data | |
| run: | | |
| cd ${{github.workspace}} | |
| source venv/bin/activate | |
| python -c "import fast;fast.downloadTestDataIfNotExists()" | |
| - name: Run tests | |
| run: | | |
| cd ${{github.workspace}} | |
| source venv/bin/activate | |
| pytest source/FAST/ -v -k 'not test_shortcuts' | |