Skip to content

Commit

Permalink
Update travis.sh for the new CI
Browse files Browse the repository at this point in the history
  • Loading branch information
alliby committed Jan 3, 2025
1 parent 5298b27 commit 6e4a5f7
Showing 1 changed file with 47 additions and 76 deletions.
123 changes: 47 additions & 76 deletions travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,81 +19,62 @@ if [[ $CHECK_CLANG_FORMAT -eq 1 ]]; then
exit 0
fi

if [[ -n $DOCKER_DISTRO ]]; then
if [[ -n $DOCKER_ARCH ]]; then
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
fi
arch="x86_64"

./docker/build.sh "$DOCKER_DISTRO" "$DOCKER_ARCH" "$DOCKER_LLVM" "$DOCKER_LUA" "$DOCKER_STATIC" "$DOCKER_SLIB" "$DOCKER_CUDA" "$DOCKER_VARIANT" "$DOCKER_TEST"
exit 0
fi

arch=$(uname -m | sed -e s/arm64/aarch64/)
if [[ $(uname) = Linux ]]; then
echo "Use Docker for testing build on Linux"
exit 1

elif [[ $(uname) = Darwin ]]; then
if [[ $LLVM_VERSION = 18 ]]; then
curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-18.1.7/clang+llvm-18.1.7-${arch}-apple-darwin.tar.xz
tar xf clang+llvm-18.1.7-${arch}-apple-darwin.tar.xz
ln -s clang+llvm-18.1.7-${arch}-apple-darwin/bin/llvm-config llvm-config-17
ln -s clang+llvm-18.1.7-${arch}-apple-darwin/bin/clang clang-17
export CMAKE_PREFIX_PATH=$PWD/clang+llvm-18.1.7-${arch}-apple-darwin
curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-18.1.7/clang+llvm-18.1.7-${arch}-linux-gnu.tar.xz
tar xf clang+llvm-18.1.7-${arch}-linux-gnu.tar.xz
ln -s clang+llvm-18.1.7-${arch}-linux-gnu/bin/llvm-config llvm-config-17
ln -s clang+llvm-18.1.7-${arch}-linux-gnu/bin/clang clang-17
export CMAKE_PREFIX_PATH=$PWD/clang+llvm-18.1.7-${arch}-linux-gnu
elif [[ $LLVM_VERSION = 17 ]]; then
curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-17.0.5/clang+llvm-17.0.5-${arch}-apple-darwin.tar.xz
tar xf clang+llvm-17.0.5-${arch}-apple-darwin.tar.xz
ln -s clang+llvm-17.0.5-${arch}-apple-darwin/bin/llvm-config llvm-config-17
ln -s clang+llvm-17.0.5-${arch}-apple-darwin/bin/clang clang-17
export CMAKE_PREFIX_PATH=$PWD/clang+llvm-17.0.5-${arch}-apple-darwin
curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-17.0.5/clang+llvm-17.0.5-${arch}-linux-gnu.tar.xz
tar xf clang+llvm-17.0.5-${arch}-linux-gnu.tar.xz
ln -s clang+llvm-17.0.5-${arch}-linux-gnu/bin/llvm-config llvm-config-17
ln -s clang+llvm-17.0.5-${arch}-linux-gnu/bin/clang clang-17
export CMAKE_PREFIX_PATH=$PWD/clang+llvm-17.0.5-${arch}-linux-gnu
elif [[ $LLVM_VERSION = 16 ]]; then
curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-16.0.3/clang+llvm-16.0.3-${arch}-apple-darwin.tar.xz
tar xf clang+llvm-16.0.3-${arch}-apple-darwin.tar.xz
ln -s clang+llvm-16.0.3-${arch}-apple-darwin/bin/llvm-config llvm-config-16
ln -s clang+llvm-16.0.3-${arch}-apple-darwin/bin/clang clang-16
export CMAKE_PREFIX_PATH=$PWD/clang+llvm-16.0.3-${arch}-apple-darwin
curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-16.0.3/clang+llvm-16.0.3-${arch}-linux-gnu.tar.xz
tar xf clang+llvm-16.0.3-${arch}-linux-gnu.tar.xz
ln -s clang+llvm-16.0.3-${arch}-linux-gnu/bin/llvm-config llvm-config-16
ln -s clang+llvm-16.0.3-${arch}-linux-gnu/bin/clang clang-16
export CMAKE_PREFIX_PATH=$PWD/clang+llvm-16.0.3-${arch}-linux-gnu
elif [[ $LLVM_VERSION = 15 ]]; then
curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-15.0.2/clang+llvm-15.0.2-${arch}-apple-darwin.tar.xz
tar xf clang+llvm-15.0.2-${arch}-apple-darwin.tar.xz
ln -s clang+llvm-15.0.2-${arch}-apple-darwin/bin/llvm-config llvm-config-15
ln -s clang+llvm-15.0.2-${arch}-apple-darwin/bin/clang clang-15
export CMAKE_PREFIX_PATH=$PWD/clang+llvm-15.0.2-${arch}-apple-darwin
curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-15.0.2/clang+llvm-15.0.2-${arch}-linux-gnu.tar.xz
tar xf clang+llvm-15.0.2-${arch}-linux-gnu.tar.xz
ln -s clang+llvm-15.0.2-${arch}-linux-gnu/bin/llvm-config llvm-config-15
ln -s clang+llvm-15.0.2-${arch}-linux-gnu/bin/clang clang-15
export CMAKE_PREFIX_PATH=$PWD/clang+llvm-15.0.2-${arch}-linux-gnu
elif [[ $LLVM_VERSION = 14 ]]; then
curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-14.0.6/clang+llvm-14.0.6-${arch}-apple-darwin.tar.xz
tar xf clang+llvm-14.0.6-${arch}-apple-darwin.tar.xz
ln -s clang+llvm-14.0.6-${arch}-apple-darwin/bin/llvm-config llvm-config-14
ln -s clang+llvm-14.0.6-${arch}-apple-darwin/bin/clang clang-14
export CMAKE_PREFIX_PATH=$PWD/clang+llvm-14.0.6-${arch}-apple-darwin
curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-14.0.6/clang+llvm-14.0.6-${arch}-linux-gnu.tar.xz
tar xf clang+llvm-14.0.6-${arch}-linux-gnu.tar.xz
ln -s clang+llvm-14.0.6-${arch}-linux-gnu/bin/llvm-config llvm-config-14
ln -s clang+llvm-14.0.6-${arch}-linux-gnu/bin/clang clang-14
export CMAKE_PREFIX_PATH=$PWD/clang+llvm-14.0.6-${arch}-linux-gnu
elif [[ $LLVM_VERSION = 13 ]]; then
curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-13.0.1/clang+llvm-13.0.1-${arch}-apple-darwin.tar.xz
tar xf clang+llvm-13.0.1-${arch}-apple-darwin.tar.xz
ln -s clang+llvm-13.0.1-${arch}-apple-darwin/bin/llvm-config llvm-config-13
ln -s clang+llvm-13.0.1-${arch}-apple-darwin/bin/clang clang-13
export CMAKE_PREFIX_PATH=$PWD/clang+llvm-13.0.1-${arch}-apple-darwin
curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-13.0.1/clang+llvm-13.0.1-${arch}-linux-gnu.tar.xz
tar xf clang+llvm-13.0.1-${arch}-linux-gnu.tar.xz
ln -s clang+llvm-13.0.1-${arch}-linux-gnu/bin/llvm-config llvm-config-13
ln -s clang+llvm-13.0.1-${arch}-linux-gnu/bin/clang clang-13
export CMAKE_PREFIX_PATH=$PWD/clang+llvm-13.0.1-${arch}-linux-gnu
elif [[ $LLVM_VERSION = 12 ]]; then
curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-12.0.1/clang+llvm-12.0.1-${arch}-apple-darwin-macos11.tar.xz
tar xf clang+llvm-12.0.1-${arch}-apple-darwin-macos11.tar.xz
ln -s clang+llvm-12.0.1-${arch}-apple-darwin/bin/llvm-config llvm-config-12
ln -s clang+llvm-12.0.1-${arch}-apple-darwin/bin/clang clang-12
export CMAKE_PREFIX_PATH=$PWD/clang+llvm-12.0.1-${arch}-apple-darwin
curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-12.0.1/clang+llvm-12.0.1-${arch}-linux-gnu.tar.xz
tar xf clang+llvm-12.0.1-${arch}-linux-gnu.tar.xz
ln -s clang+llvm-12.0.1-${arch}-linux-gnu/bin/llvm-config llvm-config-12
ln -s clang+llvm-12.0.1-${arch}-linux-gnu/bin/clang clang-12
export CMAKE_PREFIX_PATH=$PWD/clang+llvm-12.0.1-${arch}-linux-gnu
elif [[ $LLVM_VERSION = 11 ]]; then
curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-11.1.0/clang+llvm-11.1.0-${arch}-apple-darwin-macos11.tar.xz
tar xf clang+llvm-11.1.0-${arch}-apple-darwin-macos11.tar.xz
ln -s clang+llvm-11.1.0-${arch}-apple-darwin/bin/llvm-config llvm-config-11
ln -s clang+llvm-11.1.0-${arch}-apple-darwin/bin/clang clang-11
export CMAKE_PREFIX_PATH=$PWD/clang+llvm-11.1.0-${arch}-apple-darwin
curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-11.1.0/clang+llvm-11.1.0-${arch}-linux-gnu.tar.xz
tar xf clang+llvm-11.1.0-${arch}-linux-gnu.tar.xz
ln -s clang+llvm-11.1.0-${arch}-linux-gnu/bin/llvm-config llvm-config-11
ln -s clang+llvm-11.1.0-${arch}-linux-gnu/bin/clang clang-11
export CMAKE_PREFIX_PATH=$PWD/clang+llvm-11.1.0-${arch}-linux-gnu
else
echo "Don't know this LLVM version: $LLVM_VERSION"
exit 1
fi

# workaround for https://github.com/terralang/terra/issues/365
if [[ ! -e /usr/include ]]; then
export SDKROOT="$(xcrun --sdk macosx --show-sdk-path)"
fi

export PATH=$PWD:$PATH

elif [[ $(uname) = MINGW* ]]; then
if [[ $LLVM_VERSION = 14 ]]; then
curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-14.0.0/clang+llvm-14.0.0-${arch}-windows-msvc17.7z
Expand All @@ -118,7 +99,6 @@ elif [[ $(uname) = MINGW* ]]; then
elif [[ $(uname) = FreeBSD ]]; then
# Nothing to do, everything has already been installed
echo

else
echo "Don't know how to run tests on this OS: $(uname)"
exit 1
Expand Down Expand Up @@ -169,23 +149,14 @@ fi
if [[ $(uname) != MINGW* ]]; then
ctest --output-on-failure -j${THREADS:-2}
fi
popd

# Skip this on macOS because it spews too much on Mojave and newer.
if [[ $(uname) != Darwin ]]; then
pushd tests
../install/bin/terra ./run
popd
fi
popd

# Only deploy builds with LLVM 13 (macOS) and 11 (Windows).
if [[ (( $(uname) == Darwin && $LLVM_VERSION = 18 ) || ( $(uname) == MINGW* && $LLVM_VERSION = 11 && $USE_CUDA -eq 1 )) && $SLIB_INCLUDE_LLVM -eq 1 && $TERRA_LUA = luajit ]]; then
RELEASE_NAME=terra-`uname | sed -e s/Darwin/OSX/ | sed -e s/MINGW.*/Windows/`-${arch}-`git rev-parse --short HEAD`
mv install $RELEASE_NAME
if [[ $(uname) = MINGW* ]]; then
RELEASE_NAME=terra-Linux-${arch}-`git rev-parse --short HEAD`
mv install $RELEASE_NAME
if [[ $(uname) = MINGW* ]]; then
7z a -t7z $RELEASE_NAME.7z $RELEASE_NAME
else
else
tar cfJv $RELEASE_NAME.tar.xz $RELEASE_NAME
fi
mv $RELEASE_NAME install
fi
mv $RELEASE_NAME install

0 comments on commit 6e4a5f7

Please sign in to comment.