Skip to content

Commit

Permalink
Merge pull request #136 from constantinpape/master
Browse files Browse the repository at this point in the history
Switch CI to gh actions
  • Loading branch information
constantinpape authored Jan 24, 2021
2 parents c486db3 + 4380fa2 commit cc36655
Show file tree
Hide file tree
Showing 48 changed files with 2,155 additions and 1,143 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: build

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
name: ${{ matrix.os }} ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
python-version: [3.7, 3.8, 3.9]

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup miniconda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: nifty-build-env
auto-update-conda: true
channels: conda-forge
environment-file: .github/workflows/environment.yaml
python-version: ${{ matrix.python-version }}
auto-activate-base: false
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true

# this will set the system compiler;
# I don't know how to set the conda compilers for windows
- name: Set windows env
if: matrix.os == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1

- name: Build linux
if: matrix.os == 'ubuntu-latest'
shell: bash -l {0}
run: .github/workflows/build_linux.sh

- name: Build mac
if: matrix.os == 'macos-latest'
shell: bash -l {0}
run: .github/workflows/build_mac.sh

- name: Build win
if: matrix.os == 'windows-latest'
shell: bash -l {0}
run: .github/workflows/build_win.bat

- name: Run tests
shell: bash -l {0}
run: python -m unittest discover -s src/python/test -v
21 changes: 21 additions & 0 deletions .github/workflows/build_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

export PY_BIN="$CONDA_PREFIX/bin/python"
cmake . \
-DWITHIN_TRAVIS=ON \
-DWITH_QPBO=OFF \
-DWITH_HDF5=ON \
-DWITH_Z5=ON \
-DWITH_ZLIB=ON \
-DWITH_BLOSC=ON \
-DWITH_GLPK=OFF \
-DWITH_CPLEX=OFF \
-DWITH_GUROBI=OFF \
-DBUILD_CPP_TEST=OFF \
-DCMAKE_PREFIX_PATH="$CONDA_PREFIX" \
-DPYTHON_EXECUTABLE="$PY_BIN" \
-DCMAKE_CXX_FLAGS="-std=c++17" \
-DCMAKE_INSTALL_PREFIX="$CONDA_PREFIX" \
-DBUILD_NIFTY_PYTHON=ON
make -j 4
make install
21 changes: 21 additions & 0 deletions .github/workflows/build_mac.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

export PY_BIN="$CONDA_PREFIX/bin/python"
cmake . \
-DWITHIN_TRAVIS=ON \
-DWITH_QPBO=OFF \
-DWITH_HDF5=ON \
-DWITH_Z5=ON \
-DWITH_ZLIB=ON \
-DWITH_BLOSC=ON \
-DWITH_GLPK=OFF \
-DWITH_CPLEX=OFF \
-DWITH_GUROBI=OFF \
-DBUILD_CPP_TEST=OFF \
-DCMAKE_PREFIX_PATH="$CONDA_PREFIX" \
-DPYTHON_EXECUTABLE="$PY_BIN" \
-DCMAKE_CXX_FLAGS="-std=c++14" \
-DCMAKE_INSTALL_PREFIX="$CONDA_PREFIX" \
-DBUILD_NIFTY_PYTHON=ON
make -j 4
make install
18 changes: 18 additions & 0 deletions .github/workflows/build_win.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
cmake . -G "NMake Makefiles" ^
-DWITH_QPBO=OFF ^
-DWITH_HDF5=OFF ^
-DWITH_Z5=OFF ^
-DWITH_GLPK=OFF ^
-DWITH_CPLEX=OFF ^
-DWITH_GUROBI=OFF ^
-DBUILD_CPP_TEST=OFF ^
-DCMAKE_PREFIX_PATH="%CONDA_PREFIX%" ^
-DCMAKE_INSTALL_PREFIX="%CONDA_PREFIX%" ^
-DBUILD_NIFTY_PYTHON=ON

REM FIXME z5 tests still fail on windows
REM -DWITH_Z5=ON ^
REM -DWITH_ZLIB=ON ^
REM -DWITH_BLOSC=ON ^

cmake --build . --target INSTALL --config Release -j 4
22 changes: 0 additions & 22 deletions .github/workflows/ccpp.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/configure.sh

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: nifty-build-env
channels:
- conda-forge
dependencies:
- boost-cpp>=1.63
- cmake
- compilers
- h5py
- nlohmann_json
- scikit-image
- xtensor>=0.21,<0.22
- xtensor-python>=0.24,<0.25
- vigra
- z5py
2 changes: 0 additions & 2 deletions .github/workflows/test.sh

This file was deleted.

76 changes: 0 additions & 76 deletions .travis.yml

This file was deleted.

4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ find_package(Threads REQUIRED)
if(MSVC)
# Disable autolinking on MSVC.
add_definitions(-DBOOST_ALL_NO_LIB)
add_definitions(-DNOMINMAX)
endif()

# from externals..
Expand Down Expand Up @@ -267,7 +268,10 @@ endif()
# find z5
#-------------------------------------------------------------------------------------------------------------------
if(WITH_Z5)
find_package(z5 REQUIRED)
include_directories(${z5_INCLUDE_DIRS})
add_definitions(-DWITH_Z5)

option(WITH_BLOSC "Build z5 with blosc compression" ON)
option(WITH_BZIP2 "Build z5 with bzip2 compression" ON)
option(WITH_ZLIB "Build z5 with zlib compression" ON)
Expand Down
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
Travis (Ubuntu builds)
Github Workflow builds
---------------------------------
Master: [![Build Status master](https://travis-ci.org/constantinpape/nifty.svg?branch=master)](https://travis-ci.org/DerThorsten/nifty)

Appveyor (Windows builds)
---------------------------------
Master:
[![Build status](https://ci.appveyor.com/api/projects/status/u6nfcpfhpyya5mk8/branch/master?svg=true)](https://ci.appveyor.com/project/DerThorsten/nifty-5sb8n/branch/master)
[![Build Status](https://github.com/constantinpape/nifty/workflows/build/badge.svg)](https://github.com/constantinpape/nifty/actions)


Nifty
========




A nifty library for 2D and 3D image segmentation,
graph based segmentation an opt.
This library provided building blocks for segmentation
Expand Down
42 changes: 0 additions & 42 deletions appveyor.yml

This file was deleted.

2 changes: 1 addition & 1 deletion build_conda.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
WITH_CPLEX= CPLEX_ROOT_DIR= WITH_GUROBI= GUROBI_ROOT_DIR= conda build -c conda-forge --python=3.7 conda-recipe/
conda build -c conda-forge --python=3.7 conda-recipe/
Loading

0 comments on commit cc36655

Please sign in to comment.