Skip to content

Commit

Permalink
Use runner.os instead of manually defining ALPAKA_CI_OS_NAME
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminW3 committed Jul 21, 2020
1 parent 14d29bc commit b3da237
Show file tree
Hide file tree
Showing 18 changed files with 151 additions and 147 deletions.
198 changes: 101 additions & 97 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion script/after_failure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

source ./script/set.sh

if [ "$TRAVIS_OS_NAME" = "linux" ]
if [ "$ALPAKA_CI_OS_NAME" = "Linux" ]
then
sudo smem
sudo free -m -t
Expand Down
2 changes: 1 addition & 1 deletion script/before_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ then
fi

#-------------------------------------------------------------------------------
if [ "$TRAVIS_OS_NAME" = "linux" ]
if [ "$ALPAKA_CI_OS_NAME" = "Linux" ]
then
if [ "${ALPAKA_CI_STDLIB}" == "libc++" ]
then
Expand Down
4 changes: 2 additions & 2 deletions script/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ source ./script/set.sh
./script/print_env.sh
source ./script/before_install.sh

if [ "$TRAVIS_OS_NAME" = "linux" ]
if [ "$ALPAKA_CI_OS_NAME" = "Linux" ]
then
./script/docker_install.sh
./script/docker_run.sh
elif [ "$TRAVIS_OS_NAME" = "windows" ] || [ "$TRAVIS_OS_NAME" = "osx" ]
elif [ "$ALPAKA_CI_OS_NAME" = "Windows" ] || [ "$ALPAKA_CI_OS_NAME" = "macOS" ]
then
./script/install.sh
./script/run.sh
Expand Down
2 changes: 1 addition & 1 deletion script/docker_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ source ./script/set.sh
ALPAKA_DOCKER_ENV_LIST=()
ALPAKA_DOCKER_ENV_LIST+=("--env" "CC=${CC}")
ALPAKA_DOCKER_ENV_LIST+=("--env" "CXX=${CXX}")
ALPAKA_DOCKER_ENV_LIST+=("--env" "TRAVIS_OS_NAME=${TRAVIS_OS_NAME}")
ALPAKA_DOCKER_ENV_LIST+=("--env" "ALPAKA_CI_OS_NAME=${ALPAKA_CI_OS_NAME}")
ALPAKA_DOCKER_ENV_LIST+=("--env" "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
ALPAKA_DOCKER_ENV_LIST+=("--env" "ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=${ALPAKA_CI_DOCKER_BASE_IMAGE_NAME}")
ALPAKA_DOCKER_ENV_LIST+=("--env" "ALPAKA_CI_ANALYSIS=${ALPAKA_CI_ANALYSIS}")
Expand Down
2 changes: 1 addition & 1 deletion script/docker_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ source ./script/set.sh
ALPAKA_DOCKER_ENV_LIST=()
ALPAKA_DOCKER_ENV_LIST+=("--env" "CC=${CC}")
ALPAKA_DOCKER_ENV_LIST+=("--env" "CXX=${CXX}")
ALPAKA_DOCKER_ENV_LIST+=("--env" "TRAVIS_OS_NAME=${TRAVIS_OS_NAME}")
ALPAKA_DOCKER_ENV_LIST+=("--env" "ALPAKA_CI_OS_NAME=${ALPAKA_CI_OS_NAME}")
ALPAKA_DOCKER_ENV_LIST+=("--env" "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
ALPAKA_DOCKER_ENV_LIST+=("--env" "ALPAKA_CI_ANALYSIS=${ALPAKA_CI_ANALYSIS}")
ALPAKA_DOCKER_ENV_LIST+=("--env" "ALPAKA_CI_BOOST_BRANCH=${ALPAKA_CI_BOOST_BRANCH}")
Expand Down
10 changes: 5 additions & 5 deletions script/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ source ./script/set.sh
: ${ALPAKA_CI_INSTALL_HIP?"ALPAKA_CI_INSTALL_HIP must be specified"}
: ${ALPAKA_CI_INSTALL_TBB?"ALPAKA_CI_INSTALL_TBB must be specified"}

if [ "$TRAVIS_OS_NAME" = "linux" ]
if [ "$ALPAKA_CI_OS_NAME" = "Linux" ]
then
travis_retry apt-get -y --quiet update
travis_retry apt-get -y install sudo
Expand All @@ -37,7 +37,7 @@ then
travis_retry sudo apt-get -y --quiet --allow-unauthenticated --no-install-recommends install software-properties-common wget git make binutils xz-utils
fi

if [ "$TRAVIS_OS_NAME" = "linux" ] || [ "$TRAVIS_OS_NAME" = "windows" ]
if [ "$ALPAKA_CI_OS_NAME" = "Linux" ] || [ "$ALPAKA_CI_OS_NAME" = "Windows" ]
then
./script/install_cmake.sh
fi
Expand All @@ -47,12 +47,12 @@ if [ "${ALPAKA_CI_ANALYSIS}" == "ON" ] ;then ./script/install_analysis.sh ;fi
# Install CUDA before installing gcc as it installs gcc-4.8 and overwrites our selected compiler
if [ "${ALPAKA_CI_INSTALL_CUDA}" == "ON" ] ;then ./script/install_cuda.sh ;fi

if [ "$TRAVIS_OS_NAME" = "linux" ]
if [ "$ALPAKA_CI_OS_NAME" = "Linux" ]
then
if [ "${CXX}" == "g++" ] ;then ./script/install_gcc.sh ;fi
if [ "${CXX}" == "clang++" ] ;then source ./script/install_clang.sh ;fi
if [ "${ALPAKA_CI_INSTALL_HIP}" == "ON" ] ;then ./script/install_hip.sh ;fi
elif [ "$TRAVIS_OS_NAME" = "osx" ]
elif [ "$ALPAKA_CI_OS_NAME" = "macOS" ]
then
sudo xcode-select -s "/Applications/Xcode_${ALPAKA_CI_XCODE_VER}.app/Contents/Developer"
fi
Expand All @@ -64,7 +64,7 @@ fi

./script/install_boost.sh

if [ "$TRAVIS_OS_NAME" = "linux" ]
if [ "$ALPAKA_CI_OS_NAME" = "Linux" ]
then
# Minimize docker image size
sudo apt-get --quiet --purge autoremove
Expand Down
4 changes: 2 additions & 2 deletions script/install_analysis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ source ./script/travis_retry.sh

source ./script/set.sh

if [ "$TRAVIS_OS_NAME" = "linux" ]
if [ "$ALPAKA_CI_OS_NAME" = "Linux" ]
then
#-------------------------------------------------------------------------------
# Install sloc
Expand All @@ -26,7 +26,7 @@ then
travis_retry sudo apt-get -y --quiet --allow-unauthenticated --no-install-recommends install shellcheck
shellcheck --version

elif [ "$TRAVIS_OS_NAME" = "osx" ]
elif [ "$ALPAKA_CI_OS_NAME" = "macOS" ]
then
#-------------------------------------------------------------------------------
# Install sloc
Expand Down
24 changes: 12 additions & 12 deletions script/install_boost.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ source ./script/set.sh

: "${BOOST_ROOT?'BOOST_ROOT must be specified'}"
: "${ALPAKA_CI_BOOST_LIB_DIR?'ALPAKA_CI_BOOST_LIB_DIR must be specified'}"
if [ "$TRAVIS_OS_NAME" = "linux" ]
if [ "$ALPAKA_CI_OS_NAME" = "Linux" ]
then
: "${ALPAKA_CI_STDLIB?'ALPAKA_CI_STDLIB must be specified'}"
fi
Expand All @@ -23,15 +23,15 @@ fi
: "${CC?'CC must be specified'}"
: "${ALPAKA_CI_INSTALL_FIBERS?'ALPAKA_CI_INSTALL_FIBERS must be specified'}"
: "${ALPAKA_CI_BOOST_LIB_DIR?'ALPAKA_CI_BOOST_LIB_DIR must be specified'}"
if [ "$TRAVIS_OS_NAME" = "windows" ]
if [ "$ALPAKA_CI_OS_NAME" = "Windows" ]
then
: "${ALPAKA_CI_CL_VER?'ALPAKA_CI_CL_VER must be specified'}"
fi

git clone -b "${ALPAKA_CI_BOOST_BRANCH}" --quiet --recursive --single-branch --depth 1 https://github.com/boostorg/boost.git "${BOOST_ROOT}"

# Bootstrap boost.
if [ "$TRAVIS_OS_NAME" = "windows" ]
if [ "$ALPAKA_CI_OS_NAME" = "Windows" ]
then
(cd "${BOOST_ROOT}"; ./bootstrap.bat)
else
Expand All @@ -40,7 +40,7 @@ fi
(cd "${BOOST_ROOT}"; cat ./bootstrap.log)

# Create file links.
if [ "$TRAVIS_OS_NAME" = "windows" ]
if [ "$ALPAKA_CI_OS_NAME" = "Windows" ]
then
(cd "${BOOST_ROOT}"; ./b2 headers)
else
Expand All @@ -58,19 +58,19 @@ then
ALPAKA_BOOST_B2_CFLAGS=""
ALPAKA_BOOST_B2_CXXFLAGS=""

if [ "$TRAVIS_OS_NAME" = "linux" ] || [ "$TRAVIS_OS_NAME" = "osx" ]
if [ "$ALPAKA_CI_OS_NAME" = "Linux" ] || [ "$ALPAKA_CI_OS_NAME" = "macOS" ]
then
ALPAKA_BOOST_B2+="sudo "
fi
ALPAKA_BOOST_B2+="./b2 -j1"

if [ "$TRAVIS_OS_NAME" = "linux" ] || [ "$TRAVIS_OS_NAME" = "osx" ]
if [ "$ALPAKA_CI_OS_NAME" = "Linux" ] || [ "$ALPAKA_CI_OS_NAME" = "macOS" ]
then
ALPAKA_BOOST_B2_CFLAGS+="-fPIC"
ALPAKA_BOOST_B2_CXXFLAGS+="-fPIC"
fi

if [ "$TRAVIS_OS_NAME" = "windows" ]
if [ "$ALPAKA_CI_OS_NAME" = "Windows" ]
then
ALPAKA_BOOST_B2+=" --layout=versioned"
if [ "$ALPAKA_CI_CL_VER" = "2017" ]
Expand All @@ -87,7 +87,7 @@ then
# TODO: Win32: adress-model=32
ALPAKA_BOOST_B2+=" architecture=x86 address-model=64 link=static threading=multi runtime-link=shared"

if [ "$TRAVIS_OS_NAME" = "windows" ]
if [ "$ALPAKA_CI_OS_NAME" = "Windows" ]
then
ALPAKA_BOOST_B2+=" define=_CRT_NONSTDC_NO_DEPRECATE define=_CRT_SECURE_NO_DEPRECATE define=_SCL_SECURE_NO_DEPRECAT define=BOOST_USE_WINFIBERS define=_ENABLE_EXTENDED_ALIGNED_STORAGE"
fi
Expand All @@ -109,7 +109,7 @@ then
# If the variable is not set, the backend will most probably be used by default so we install it.
if [ "${ALPAKA_CI_INSTALL_FIBERS}" == "ON" ]
then
if [ "$TRAVIS_OS_NAME" = "linux" ]
if [ "$ALPAKA_CI_OS_NAME" = "Linux" ]
then
ALPAKA_BOOST_B2_CXXFLAGS+=" -std=c++14"
fi
Expand All @@ -125,7 +125,7 @@ then
then
ALPAKA_BOOST_B2+=' cxxflags="'
ALPAKA_BOOST_B2+="${ALPAKA_BOOST_B2_CXXFLAGS}"
if [ "$TRAVIS_OS_NAME" = "linux" ]
if [ "$ALPAKA_CI_OS_NAME" = "Linux" ]
then
if [ "${ALPAKA_CI_STDLIB}" == "libc++" ]
then
Expand All @@ -135,7 +135,7 @@ then
ALPAKA_BOOST_B2+='"'
fi

if [ "$TRAVIS_OS_NAME" = "linux" ]
if [ "$ALPAKA_CI_OS_NAME" = "Linux" ]
then
if [ "${ALPAKA_CI_STDLIB}" == "libc++" ]
then
Expand All @@ -150,7 +150,7 @@ then
(cd "${BOOST_ROOT}"; eval "${ALPAKA_BOOST_B2}")

# Clean the intermediate build files.
if [ "$TRAVIS_OS_NAME" = "windows" ]
if [ "$ALPAKA_CI_OS_NAME" = "Windows" ]
then
rm -rf bin.v2
else
Expand Down
4 changes: 2 additions & 2 deletions script/install_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ source ./script/set.sh
: "${ALPAKA_CI_CMAKE_DIR?'ALPAKA_CI_CMAKE_DIR must be specified'}"
: "${ALPAKA_CI_CMAKE_VER?'ALPAKA_CI_CMAKE_VER must be specified'}"

if [ "$TRAVIS_OS_NAME" = "linux" ]
if [ "$ALPAKA_CI_OS_NAME" = "Linux" ]
then
# Download the selected version.
if [ -z "$(ls -A ${ALPAKA_CI_CMAKE_DIR})" ]
Expand All @@ -34,7 +34,7 @@ then
sudo cp -fR "${ALPAKA_CI_CMAKE_DIR}"/"${ALPAKA_CMAKE_PKG_FILE_NAME_BASE}"/* "${ALPAKA_CI_CMAKE_DIR}"
sudo rm -rf "${ALPAKA_CMAKE_PKG_FILE_NAME}" "${ALPAKA_CI_CMAKE_DIR}"/"${ALPAKA_CMAKE_PKG_FILE_NAME_BASE}"
fi
elif [ "$TRAVIS_OS_NAME" = "windows" ]
elif [ "$ALPAKA_CI_OS_NAME" = "Windows" ]
then
choco uninstall cmake.install
choco install cmake.install --no-progress --version ${ALPAKA_CI_CMAKE_VER}
Expand Down
4 changes: 2 additions & 2 deletions script/install_cuda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ source ./script/set.sh

: "${ALPAKA_CUDA_VERSION?'ALPAKA_CUDA_VERSION must be specified'}"

if [ "$TRAVIS_OS_NAME" = "linux" ]
if [ "$ALPAKA_CI_OS_NAME" = "Linux" ]
then
: "${ALPAKA_CI_DOCKER_BASE_IMAGE_NAME?'ALPAKA_CI_DOCKER_BASE_IMAGE_NAME must be specified'}"
: "${ALPAKA_CI_CUDA_DIR?'ALPAKA_CI_CUDA_DIR must be specified'}"
Expand Down Expand Up @@ -100,7 +100,7 @@ then
# clean up
sudo rm -rf "${ALPAKA_CI_CUDA_DIR}"/"${ALPAKA_CUDA_PKG_FILE_NAME}"
sudo dpkg --purge "${ALPAKA_CUDA_PKG_DEB_NAME}"
elif [ "$TRAVIS_OS_NAME" = "windows" ]
elif [ "$ALPAKA_CI_OS_NAME" = "Windows" ]
then
if [ "${ALPAKA_CUDA_VERSION}" == "10.0" ]
then
Expand Down
6 changes: 3 additions & 3 deletions script/install_tbb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ source ./script/travis_retry.sh
source ./script/set.sh

# Install TBB
if [ "$TRAVIS_OS_NAME" = "linux" ]
if [ "$ALPAKA_CI_OS_NAME" = "Linux" ]
then
travis_retry sudo apt-get -y --quiet --allow-unauthenticated --no-install-recommends install libtbb-dev
elif [ "$TRAVIS_OS_NAME" = "osx" ]
elif [ "$ALPAKA_CI_OS_NAME" = "macOS" ]
then
brew unlink python@2
brew install tbb
elif [ "$TRAVIS_OS_NAME" = "windows" ]
elif [ "$ALPAKA_CI_OS_NAME" = "Windows" ]
then
TBB_ARCHIVE_VER="tbb44_20160526oss"
TBB_DOWNLOAD_URL="https://github.com/intel/tbb/releases/download/4.4.5/${TBB_ARCHIVE_VER}_win.zip"
Expand Down
2 changes: 1 addition & 1 deletion script/print_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ then
echo GITHUB_WORKSPACE: "${GITHUB_WORKSPACE}"
fi

if [ "$TRAVIS_OS_NAME" = "linux" ]
if [ "$ALPAKA_CI_OS_NAME" = "Linux" ]
then
# Show all running services
sudo service --status-all
Expand Down
18 changes: 9 additions & 9 deletions script/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ echo "ALPAKA_CI_CMAKE_DIR: ${ALPAKA_CI_CMAKE_DIR}"
echo "ALPAKA_CI_ANALYSIS: ${ALPAKA_CI_ANALYSIS}"
: "${ALPAKA_CI_INSTALL_CUDA?'ALPAKA_CI_INSTALL_CUDA must be specified'}"
: "${ALPAKA_CI_INSTALL_HIP?'ALPAKA_CI_INSTALL_HIP must be specified'}"
if [ "$TRAVIS_OS_NAME" = "linux" ]
if [ "$ALPAKA_CI_OS_NAME" = "Linux" ]
then
: "${ALPAKA_CI_STDLIB?'ALPAKA_CI_STDLIB must be specified'}"
echo "ALPAKA_CI_STDLIB: ${ALPAKA_CI_STDLIB}"
Expand All @@ -27,7 +27,7 @@ fi
echo "CXX: ${CXX}"


if [ "$TRAVIS_OS_NAME" = "linux" ]
if [ "$ALPAKA_CI_OS_NAME" = "Linux" ]
then
if [ -z "${LD_LIBRARY_PATH+x}" ]
then
Expand All @@ -36,14 +36,14 @@ then
fi

# CMake
if [ "$TRAVIS_OS_NAME" = "linux" ]
if [ "$ALPAKA_CI_OS_NAME" = "Linux" ]
then
export PATH=${ALPAKA_CI_CMAKE_DIR}/bin:${PATH}
fi
cmake --version

#TBB
if [ "$TRAVIS_OS_NAME" = "windows" ]
if [ "$ALPAKA_CI_OS_NAME" = "Windows" ]
then
#ALPAKA_TBB_BIN_DIR="${TBB_ROOT}/bin/ia32/vc14"
ALPAKA_TBB_BIN_DIR="${TBB_ROOT}/bin/intel64/vc14"
Expand All @@ -55,7 +55,7 @@ if [ "${ALPAKA_CI_INSTALL_CUDA}" == "ON" ]
then
: "${ALPAKA_CUDA_VERSION?'ALPAKA_CUDA_VERSION must be specified'}"

if [ "$TRAVIS_OS_NAME" = "linux" ]
if [ "$ALPAKA_CI_OS_NAME" = "Linux" ]
then
# CUDA
export PATH=/usr/local/cuda-${ALPAKA_CUDA_VERSION}/bin:$PATH
Expand All @@ -68,7 +68,7 @@ then
which nvcc
nvcc -V
fi
elif [ "$TRAVIS_OS_NAME" = "windows" ]
elif [ "$ALPAKA_CI_OS_NAME" = "Windows" ]
then
export PATH="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v${ALPAKA_CUDA_VERSION}\bin":$PATH
export CUDA_PATH="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v${ALPAKA_CUDA_VERSION}"
Expand Down Expand Up @@ -110,7 +110,7 @@ then
fi

# clang
if [ "$TRAVIS_OS_NAME" = "linux" ]
if [ "$ALPAKA_CI_OS_NAME" = "Linux" ]
then
if [ "${CXX}" == "clang++" ]
then
Expand All @@ -126,7 +126,7 @@ then
fi

# stdlib
if [ "$TRAVIS_OS_NAME" = "linux" ]
if [ "$ALPAKA_CI_OS_NAME" = "Linux" ]
then
if [ "${ALPAKA_CI_STDLIB}" == "libc++" ]
then
Expand All @@ -149,7 +149,7 @@ then
source ./script/prepare_sanitizers.sh
fi

if [ "$TRAVIS_OS_NAME" = "windows" ]
if [ "$ALPAKA_CI_OS_NAME" = "Windows" ]
then
: ${ALPAKA_CI_CL_VER?"ALPAKA_CI_CL_VER must be specified"}

Expand Down
2 changes: 1 addition & 1 deletion script/run_analysis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

source ./script/set.sh

if [ "$TRAVIS_OS_NAME" = "linux" ] || [ "$TRAVIS_OS_NAME" = "osx" ]
if [ "$ALPAKA_CI_OS_NAME" = "Linux" ] || [ "$ALPAKA_CI_OS_NAME" = "macOS" ]
then
#-------------------------------------------------------------------------------
# sloc
Expand Down
4 changes: 2 additions & 2 deletions script/run_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ source ./script/set.sh

cd build/

if [ "$TRAVIS_OS_NAME" = "linux" ] || [ "$TRAVIS_OS_NAME" = "osx" ]
if [ "$ALPAKA_CI_OS_NAME" = "Linux" ] || [ "$ALPAKA_CI_OS_NAME" = "macOS" ]
then
make VERBOSE=1
elif [ "$TRAVIS_OS_NAME" = "windows" ]
elif [ "$ALPAKA_CI_OS_NAME" = "Windows" ]
then
"$MSBUILD_EXECUTABLE" "alpaka.sln" -p:Configuration=${CMAKE_BUILD_TYPE} -maxcpucount:1 -verbosity:minimal
fi
Expand Down
6 changes: 3 additions & 3 deletions script/run_generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ then
fi

ALPAKA_CI_CMAKE_EXECUTABLE=cmake
if [ "$TRAVIS_OS_NAME" = "linux" ]
if [ "$ALPAKA_CI_OS_NAME" = "Linux" ]
then
ALPAKA_CI_CMAKE_EXECUTABLE="${ALPAKA_CI_CMAKE_DIR}/bin/cmake"
fi

ALPAKA_CI_CMAKE_GENERATOR_PLATFORM=""
if [ "$TRAVIS_OS_NAME" = "linux" ] || [ "$TRAVIS_OS_NAME" = "osx" ]
if [ "$ALPAKA_CI_OS_NAME" = "Linux" ] || [ "$ALPAKA_CI_OS_NAME" = "macOS" ]
then
ALPAKA_CI_CMAKE_GENERATOR="Unix Makefiles"
elif [ "$TRAVIS_OS_NAME" = "windows" ]
elif [ "$ALPAKA_CI_OS_NAME" = "Windows" ]
then
: ${ALPAKA_CI_CL_VER?"ALPAKA_CI_CL_VER must be specified"}

Expand Down
Loading

0 comments on commit b3da237

Please sign in to comment.