Skip to content

Commit

Permalink
Update CI idioms (AcademySoftwareFoundation#1338)
Browse files Browse the repository at this point in the history
* Separate the CI stages into separate steps. (As was prototyped in OIIO)

* Combine the dependency-building scripts for CentOS and Ubuntu into a
  single script.

* Get rid of cruft related to the CI systems we no longer use (Appveyor,
  Travis, CircleCI).

* Get rid of some needless CI verbosity

Signed-off-by: Larry Gritz <[email protected]>
  • Loading branch information
lgritz committed Mar 2, 2021
1 parent 424b8c3 commit db350bd
Show file tree
Hide file tree
Showing 14 changed files with 471 additions and 591 deletions.
408 changes: 248 additions & 160 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

200 changes: 0 additions & 200 deletions appveyor.yml

This file was deleted.

2 changes: 1 addition & 1 deletion src/build-scripts/build_opencolorio.bash
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ time cmake --config Release -DCMAKE_INSTALL_PREFIX=${OPENCOLORIO_INSTALL_DIR} -D
time cmake --build . --config Release --target install
popd

ls -R ${OPENCOLORIO_INSTALL_DIR}
# ls -R ${OPENCOLORIO_INSTALL_DIR}

#echo "listing .."
#ls ..
Expand Down
2 changes: 1 addition & 1 deletion src/build-scripts/build_openimageio.bash
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ export PYTHONPATH=$OpenImageIO_ROOT/lib/python${PYTHON_VERSION}/site-packages:$P
echo "DYLD_LIBRARY_PATH = $DYLD_LIBRARY_PATH"
echo "LD_LIBRARY_PATH = $LD_LIBRARY_PATH"
echo "OpenImageIO_ROOT $OpenImageIO_ROOT"
ls -R $OpenImageIO_ROOT
# ls -R $OpenImageIO_ROOT
2 changes: 1 addition & 1 deletion src/build-scripts/build_pugixml.bash
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ time cmake --config Release \
${PUGIXML_BUILD_OPTS} ..
time cmake --build . --config Release --target install

ls -R ${PUGIXML_INSTALL_DIR}
# ls -R ${PUGIXML_INSTALL_DIR}
popd

#echo "listing .."
Expand Down
2 changes: 1 addition & 1 deletion src/build-scripts/build_pybind11.bash
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ time cmake --config Release \
${PYBIND11_BUILD_OPTS} ..
time cmake --build . --config Release --target install

ls -R ${PYBIND11_INSTALL_DIR}
# ls -R ${PYBIND11_INSTALL_DIR}
popd

#echo "listing .."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,9 @@
# any command in it fails. This is crucial for CI tests.
set -ex

# This script is run when CI system first starts up.
# It expects that ci-setenv.bash was run first, so $PLATFORM and $ARCH
# have been set.

if [[ -e src/build-scripts/ci-setenv.bash ]] ; then
source src/build-scripts/ci-setenv.bash
fi

mkdir -p build/$PLATFORM dist/$PLATFORM && true

if [[ "$USE_SIMD" != "" ]] ; then
OSL_CMAKE_FLAGS="$OSL_CMAKE_FLAGS -DUSE_SIMD=$USE_SIMD"
fi
if [[ "$DEBUG" == "1" ]] ; then
OSL_CMAKE_FLAGS="$OSL_CMAKE_FLAGS -DCMAKE_BUILD_TYPE=Debug"
fi

pushd build/$PLATFORM
cmake ../.. -G "$CMAKE_GENERATOR" \
Expand All @@ -37,8 +24,6 @@ cmake ../.. -G "$CMAKE_GENERATOR" \
$OSL_CMAKE_FLAGS -DVERBOSE=1
time cmake --build . --target ${BUILDTARGET:=install} --config ${CMAKE_BUILD_TYPE}
popd
#make $MAKEFLAGS VERBOSE=1 $BUILD_FLAGS config
#make $MAKEFLAGS $PAR_MAKEFLAGS $BUILD_FLAGS $BUILDTARGET

if [[ "${DEBUG_CI:=0}" != "0" ]] ; then
echo "PATH=$PATH"
Expand All @@ -48,14 +33,6 @@ if [[ "${DEBUG_CI:=0}" != "0" ]] ; then
ldd $OSL_ROOT/bin/testshade
fi

if [[ "$SKIP_TESTS" == "" ]] ; then
$OSL_ROOT/bin/testshade --help
export OIIO_LIBRARY_PATH=$OSL_ROOT/lib:$OIIO_LIBRARY_PATH
export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$OSL_ROOT/src/cmake/modules
TESTSUITE_CLEANUP_ON_SUCCESS=1
make $BUILD_FLAGS test
fi

if [[ "$BUILDTARGET" == clang-format ]] ; then
git diff --color
THEDIFF=`git diff`
Expand All @@ -64,7 +41,3 @@ if [[ "$BUILDTARGET" == clang-format ]] ; then
exit 1
fi
fi

#if [[ "$CODECOV" == 1 ]] ; then
# bash <(curl -s https://codecov.io/bash)
#fi
30 changes: 14 additions & 16 deletions src/build-scripts/ci-startup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@
# with 'source', not in a separate shell.

# Figure out the platform
if [[ $RUNNER_OS == macOS ]] ; then
export ARCH=macosx
elif [[ `uname -m` == aarch64 ]] ; then
export ARCH=aarch64
if [[ $$RUNNER_OS == macOS ]] ; then
export ARCH=macosx
elif [[ $RUNNER_OS == Linux ]] ; then
export ARCH=linux64
export ARCH=linux64
elif [[ $RUNNER_OS == Windows ]] ; then
export ARCH=windows64
export ARCH=windows64
elif [[ `uname -m` == aarch64 ]] ; then
export ARCH=aarch64
else
export ARCH=unknown
fi
export PLATFORM=$ARCH

if [[ "$DEBUG" == 1 ]] ; then
if [[ "${DEBUG:=0}" != "0" ]] ; then
export PLATFORM=${PLATFORM}.debug
fi

Expand Down Expand Up @@ -60,15 +60,6 @@ export CMAKE_GENERATOR=${CMAKE_GENERATOR:=Ninja}
export CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:=Release}
export CMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD:=11}

if [[ $TRAVIS == true && "$ARCH" == aarch64 ]] ; then
export PARALLEL=4
elif [[ $TRAVIS == true ]] ; then
export PARALLEL=2
elif [[ $CIRCLECI == true ]] ; then
export PARALLEL=4
elif [[ $GITHUB_ACTIONS == true ]] ; then
export PARALLEL=4
fi
export PARALLEL=${PARALLEL:=4}
export PAR_MAKEFLAGS=-j${PARALLEL}
export CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL:=${PARALLEL}}
Expand All @@ -80,6 +71,10 @@ export LD_LIBRARY_PATH=${LOCAL_DEPS_DIR}/dist/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${LOCAL_DEPS_DIR}/dist/lib64:$LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=${LOCAL_DEPS_DIR}/dist/lib:$DYLD_LIBRARY_PATH

export TESTSUITE_CLEANUP_ON_SUCCESS=${TESTSUITE_CLEANUP_ON_SUCCESS:=1}

mkdir -p build/$PLATFORM dist/$PLATFORM

echo "HOME = $HOME"
echo "PWD = $PWD"
echo "LOCAL_DEPS_DIR = $LOCAL_DEPS_DIR"
Expand All @@ -96,3 +91,6 @@ if [[ `uname -s` == "Linux" ]] ; then
elif [[ $ARCH == macosx ]] ; then
sysctl machdep.cpu.features
fi

# Save the env for use by other stages
src/build-scripts/save-env.bash
22 changes: 22 additions & 0 deletions src/build-scripts/ci-test.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage

# Important: set -ex causes this whole script to terminate with error if
# any command in it fails. This is crucial for CI tests.
set -ex

$OSL_ROOT/bin/testshade --help

echo "Parallel test " ${CTEST_PARALLEL_LEVEL}
pushd build/$PLATFORM
time ctest -C ${CMAKE_BUILD_TYPE} -E broken --force-new-ctest-process \
--output-on-failure --timeout ${CTEST_TEST_TIMEOUT:=180} ${CTEST_ARGS}
popd


# if [[ "$CODECOV" == 1 ]] ; then
# bash <(curl -s https://codecov.io/bash)
# fi
Loading

0 comments on commit db350bd

Please sign in to comment.