More consistent use of dip::LabelType, deprecated some dip::uint labe… #163
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: "CI tests" | |
on: | |
push: | |
branches: [ master ] | |
paths: | |
- 'dependencies/**' | |
- 'include/**' | |
- 'javaio/**' | |
- 'pydip/**' | |
- 'src/**' | |
- 'viewer/**' | |
- 'CMakeLists.txt' | |
- '!**/README*' | |
- '!**/readme*' | |
- '.github/workflows/cmake.yml' | |
pull_request: | |
branches: [ master ] | |
paths: | |
- 'dependencies/**' | |
- 'include/**' | |
- 'javaio/**' | |
- 'pydip/**' | |
- 'src/**' | |
- 'viewer/**' | |
- 'CMakeLists.txt' | |
- '!**/README*' | |
- '!**/readme*' | |
env: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
BUILD_TYPE: Release | |
jobs: | |
build: | |
runs-on: ${{matrix.os}} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
include: | |
- os: ubuntu-latest | |
n_cores: 4 | |
wheel_location: pydip/staging/dist | |
- os: macos-latest | |
n_cores: 3 | |
dip_cmake_opts: -DCMAKE_CXX_FLAGS="-I/usr/local/opt/libomp/include -L/usr/local/opt/libomp/lib" | |
wheel_location: pydip/staging/dist | |
- os: windows-latest | |
n_cores: 4 | |
dip_cmake_opts: -A x64 -DDIP_ENABLE_UNICODE=Off -DGLFW_INCLUDE_DIR="glfw-3.3.5.bin.WIN64/include" -DGLFW_LIBRARY="glfw-3.3.5.bin.WIN64/lib-vc2019/glfw3.lib" -DDIP_FIND_FREEGLUT=Off | |
# Windows build must be 64-bit. We're also disabling Unicode because otherwise some tests fail. | |
wheel_location: pydip/Release/staging/dist | |
fail-fast: true | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install | |
# Install libraries and Python packages we need | |
run: | | |
if [ "$RUNNER_OS" == "Linux" ]; then | |
sudo apt-get update | |
sudo apt-get -y install freeglut3-dev | |
python3 -m pip install setuptools wheel build numpy | |
elif [ "$RUNNER_OS" == "Windows" ]; then | |
choco install openjdk8 --no-progress --yes | |
python -m pip install setuptools wheel build numpy wget | |
python -m wget https://github.com/glfw/glfw/releases/download/3.3.5/glfw-3.3.5.bin.WIN64.zip | |
python -c "import zipfile; zip = zipfile.ZipFile('glfw-3.3.5.bin.WIN64.zip', 'r'); zip.extractall()" | |
elif [ "$RUNNER_OS" == "macOS" ]; then | |
brew install libomp glfw | |
python3 -m pip install --break-system-packages setuptools wheel build numpy | |
fi | |
shell: bash | |
- name: Configure | |
run: | | |
if [ "$RUNNER_OS" == "Windows" ]; then | |
python_executable=`which python` | |
else | |
python_executable=`which python3` | |
fi | |
cmake -B '${{github.workspace}}/build' -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{matrix.dip_cmake_opts}} -DDIP_ENABLE_ASSERT=ON -DDIP_PYDIP_WHEEL_INCLUDE_LIBS=ON -DPython_EXECUTABLE=$python_executable | |
shell: bash | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel ${{matrix.n_cores}} | |
- name: Test | |
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target check | |
- name: Package | |
# Create the Python distribution wheel | |
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target bdist_wheel | |
- name: Archive | |
# Store the Python distribution wheel | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Python-wheel-${{matrix.os}} | |
path: ${{github.workspace}}/build/${{matrix.wheel_location}}/*.whl |