diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 91ed961b3e..7cdfbdd240 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,5 +1,19 @@ # Azure CI build file # https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema + + +trigger: + batch: true + branches: + include: + - master + - ci-test + +pr: + autoCancel: true + branches: + include: + - master jobs: # ------------------------------------------------------------------------------ @@ -14,12 +28,34 @@ jobs: - job: Linux strategy: matrix: - CentOS 7 VFX CY2019: + CentOS 7 gcc VFX CY2019: agentImage: 'ubuntu-16.04' containerImage: aswfstaging/ci-base:2019 cxxCompiler: g++ cCompiler: gcc - installSh: '' + installSh: | + sudo share/ci/scripts/linux/install_cmake.sh 3.12.4 +# CentOS 7 gcc VFX CY2020: +# agentImage: 'ubuntu-16.04' +# containerImage: aswfstaging/ci-base:2020 +# cxxCompiler: g++ +# cCompiler: gcc +# installSh: | +# sudo share/ci/scripts/linux/install_cmake.sh 3.12.4 + CentOS 7 Clang 7 VFX CY2019: + agentImage: 'ubuntu-16.04' + containerImage: aswfstaging/ci-base:2019 + cxxCompiler: clang++ + cCompiler: clang + installSh: | + sudo share/ci/scripts/linux/install_cmake.sh 3.12.4 +# CentOS 7 Clang 7 VFX CY2020: +# agentImage: 'ubuntu-16.04' +# containerImage: aswfstaging/ci-base:2020 +# cxxCompiler: clang++ +# cCompiler: clang +# installSh: | +# sudo share/ci/scripts/linux/install_cmake.sh 3.12.4 pool: vmImage: $(agentImage) container: $[ variables['containerImage'] ] @@ -30,7 +66,6 @@ jobs: displayName: Install dependencies condition: and(succeeded(), variables['installSh']) - - template: share/ci/templates/configure.yml parameters: cxxCompiler: $(cxxCompiler) @@ -49,26 +84,6 @@ jobs: testResultsFormat: 'cTest' testResultsFiles: '**/Test*.xml' failTaskOnFailedTests: true -#pool: -# vmImage: 'ubuntu-16.04' -# container: aswfstaging/ci-base:2019 -# steps: -# - bash: | -# mkdir _build -# cd _build -# cmake -DOPENEXR_BUILD_VIEWERS=OFF .. -# echo "Working directory $PWD" -# export LD_LIBRARY_PATH=$PWD/IlmBase/Half:$PWD/IlmBase/IlmThread:$PWD/IlmBase/Iex:$PWD/IlmBase/IexMath:$PWD/IlmBase/Imath:$PWD/OpenEXR/IlmImf:$PWD/OpenEXR/IlmImfUtil:$LD_LIBRARY_PATH -# echo `ls $PWD/IlmBase/Half` -# echo $LD_LIBRARY_PATH -# echo "Hello World" -# make -j4 -# echo `ls $PWD/IlmBase/Half` -# displayName: Build -# - bash: | -# cd _build -# ctest -T Test --output-on-failure -VV -E PyImathNumpyTest -# displayName: Test # ------------------------------------------------------------------------------ # SonarCloud static analysis @@ -82,6 +97,8 @@ jobs: steps: - template: share/ci/templates/checkout.yml + - bash: sudo share/ci/scripts/linux/install_cmake.sh 3.12.4 + displayName: Install dependencies - template: share/ci/templates/configure.yml parameters: cxxFlags: -g -O0 -fprofile-arcs -ftest-coverage @@ -91,5 +108,70 @@ jobs: - template: share/ci/templates/build_sonar.yml +# ------------------------------------------------------------------------------ +# macOS +# ------------------------------------------------------------------------------ +#- job: macOS +# strategy: +# matrix: +# 10.14 AppleClang 10.0: +# agentImage: 'macOS-10.14' +# 10.13 AppleClang 10.0: +# agentImage: 'macOS-10.13' +# pool: +# vmImage: $(agentImage) + +# steps: +# - template: share/ci/templates/checkout.yml +# - bash: | +# share/ci/scripts/macos/install.sh +# share/ci/scripts/macos/install_python.sh 2.7.16 +# displayName: Install dependencies + +# - template: share/ci/templates/configure.yml +# parameters: +# cmakeOpts: | +# -DPYTHON_INCLUDE_DIR=$(python-config --prefix)/include/python2.7 \ +# -DPYTHON_LIBRARY=$(python-config --prefix)/lib/libpython2.7.dylib \ +# -DPYTHON_EXECUTABLE=$(which python2) + +# - template: share/ci/templates/build.yml +# parameters: +# cmakeOpts: -- -j4 + +# ------------------------------------------------------------------------------ +# Windows +# ------------------------------------------------------------------------------ +#- job: Windows +# strategy: +# matrix: +# 2016 MSVC 14.16: +# agentImage: 'vs2017-win2016' +# buildSharedLibs: ON +# 2016 MSVC 14.16 (Static): +# agentImage: 'vs2017-win2016' +# buildSharedLibs: OFF +# 2012 MSVC 14.0: +# agentImage: 'vs2015-win2012r2' +# buildSharedLibs: ON +# pool: +# vmImage: $(agentImage) + +# steps: +# - template: share/ci/templates/checkout.yml +# - powershell: | +# share/ci/scripts/windows/install_python.ps1 2.7.16 +# share/ci/scripts/windows/install_cmake.ps1 3.14.4 +# displayName: Install dependencies +# +# - template: share/ci/templates/configure.yml +# parameters: +# buildSharedLibs: $(buildSharedLibs) +# verbose: ON +# cmakeOpts: | +# -DCMAKE_GENERATOR_PLATFORM=x64 \ +# -DPYTHON_EXECUTABLE=$(which python) +# +# - template: share/ci/templates/build.yml diff --git a/share/ci/scripts/linux/install_boost.sh b/share/ci/scripts/linux/install_boost.sh new file mode 100755 index 0000000000..471ecffb79 --- /dev/null +++ b/share/ci/scripts/linux/install_boost.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +set -ex + +BOOST_VERSION="$1" +BOOST_MAJOR_MINOR=$(echo "${BOOST_VERSION}" | cut -d. -f-2) +BOOST_MAJOR=$(echo "${BOOST_VERSION}" | cut -d. -f-1) +BOOST_MINOR=$(echo "${BOOST_MAJOR_MINOR}" | cut -d. -f2-) +BOOST_PATCH=$(echo "${BOOST_VERSION}" | cut -d. -f3-) +BOOST_VERSION_U="${BOOST_MAJOR}_${BOOST_MINOR}_${BOOST_PATCH}" + +mkdir _boost +cd _boost + +wget -q https://sourceforge.net/projects/boost/files/boost/${BOOST_VERSION}/boost_${BOOST_VERSION_U}.tar.gz +tar -xzf boost_${BOOST_VERSION_U}.tar.gz + +cd boost_${BOOST_VERSION_U} +sh bootstrap.sh +./b2 install -j4 variant=release toolset=gcc \ + --with-system \ + --with-regex \ + --with-filesystem \ + --with-thread \ + --with-python \ + --prefix=/usr/local + +cd ../.. +rm -rf _boost diff --git a/share/ci/scripts/linux/install_cmake.sh b/share/ci/scripts/linux/install_cmake.sh new file mode 100755 index 0000000000..7f194ed3fd --- /dev/null +++ b/share/ci/scripts/linux/install_cmake.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +set -ex + +echo "Updating to newer cmake to enable python-3" + +CMAKE_VERSION="$1" + +curl --location "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.sh" -o /tmp/cmake.sh +cd /tmp && sh cmake.sh --skip-license --prefix=/usr/local --exclude-subdir +rm /tmp/cmake.sh + +echo $(ls /usr/local/bin) +echo $(which cmake) diff --git a/share/ci/templates/build.yml b/share/ci/templates/build.yml index b4c1b523dc..b799a88e34 100644 --- a/share/ci/templates/build.yml +++ b/share/ci/templates/build.yml @@ -15,7 +15,7 @@ steps: if [ "$CCOMPILER" ]; then export CC="$CCOMPILER" fi - export LD_LIBRARY_PATH=$PWD/IlmBase/Half:$PWD/IlmBase/IlmThread:$PWD/IlmBase/Iex:$PWD/IlmBase/IexMath:$PWD/IlmBase/Imath:$PWD/OpenEXR/IlmImf:$PWD/OpenEXR/IlmImfUtil:$LD_LIBRARY_PATH + echo `which cmake` cmake --build . \ --target install \ --config ${{ parameters.buildType }} \ diff --git a/share/ci/templates/configure.yml b/share/ci/templates/configure.yml index e80900b447..4c04df4ee8 100644 --- a/share/ci/templates/configure.yml +++ b/share/ci/templates/configure.yml @@ -3,18 +3,8 @@ parameters: buildType: Release - buildIlmBase: ON - buildOpenEXR: ON - buildPythonLibs: ON - buildSharedLibs: ON - buildStaticLibs: OFF - buildTests: ON buildUtils: ON - buildViewers: OFF forceCXX03: OFF - useNamespaceVersioning: OFF - pythonMajor: 2 - pythonMinor: 7 runFuzzTests: OFF verbose: OFF cxxStd: 14 @@ -36,30 +26,14 @@ steps: if [ "$CCOMPILER" ]; then export CC="$CCOMPILER" fi - cmake ../. \ + /usr/local/bin/cmake ../. \ -DCMAKE_INSTALL_PREFIX=../_install \ -DCMAKE_BUILD_TYPE=${{ parameters.buildType }} \ -DCMAKE_CXX_STANDARD=${{ parameters.cxxStd }} \ -DCMAKE_CXX_FLAGS="${{ parameters.cxxFlags }}" \ -DCMAKE_VERBOSE_MAKEFILE:BOOL=${{ parameters.verbose }} \ -DBUILD_SHARED_LIBS=${{ parameters.buildSharedLibs }} \ - -DOCIO_BUILD_TESTS=${{ parameters.buildTests }} \ - -DOCIO_BUILD_GPU_TESTS=${{ parameters.buildGpuTests }} \ - -DOCIO_BUILD_DOCS=${{ parameters.buildDocs }} \ - -DOCIO_USE_SSE=${{ parameters.useSSE }} \ - -DOCIO_WARNING_AS_ERROR=ON \ - -DOPENEXR_BUILD_ILMBASE=${{ parameters.buildIlmBase }} \ - -DOPENEXR_BUILD_OPENEXR=${{ parameters.buildOpenEXR }} \ - -DOPENEXR_BUILD_PYTHONLIBS=${{ parameters.buildPythonLibs }} \ - -DOPENEXR_BUILD_SHARED=${{ parameters.buildSharedLibs }} \ - -DOPENEXR_BUILD_STATIC=${{ parameters.buildStaticLibs }} \ - -DOPENEXR_BUILD_TESTS=${{ parameters.buildTests }} \ -DOPENEXR_BUILD_UTILS=${{ parameters.buildUtils }} \ - -DOPENEXR_BUILD_VIEWERS=${{ parameters.buildViewers }} \ - -DOPENEXR_FORCE_CXX03=${{ parameters.forceCXX03 }} \ - -DOPENEXR_NAMESPACE_VERSIONING=${{ parameters.useNamespaceVersioning }} \ - -DOPENEXR_PYTHON_MAJOR=${{ parameters.pythonMajor }} \ - -DOPENEXR_PYTHON_MINOR=${{ parameters.pythonMinor }} \ -DOPENEXR_RUN_FUZZ_TESTS=${{ parameters.runFuzzTests }} \ ${{ parameters.cmakeOpts }} workingDirectory: _build diff --git a/share/ci/templates/test.yml b/share/ci/templates/test.yml index 8777268d4c..f3bec1e179 100644 --- a/share/ci/templates/test.yml +++ b/share/ci/templates/test.yml @@ -3,7 +3,6 @@ steps: - bash: | - export LD_LIBRARY_PATH=$PWD/IlmBase/Half:$PWD/IlmBase/IlmThread:$PWD/IlmBase/Iex:$PWD/IlmBase/IexMath:$PWD/IlmBase/Imath:$PWD/OpenEXR/IlmImf:$PWD/OpenEXR/IlmImfUtil:$LD_LIBRARY_PATH - ctest -T Test --output-on-failure -VV -E PyImathNumpyTest + ctest -T Test -E PyIlmBase.* --output-on-failure -VV workingDirectory: _build displayName: Test OpenEXR