From 8ed4d6e173194229b75cd8bacbaa7fd3ed1eefc2 Mon Sep 17 00:00:00 2001 From: ShadowLarkens Date: Tue, 21 Jul 2020 17:35:15 -0700 Subject: [PATCH] Attempt to compile TGUI as part of TRAVIS --- .travis.yml | 20 +++++++++++--------- _build_dependencies.sh | 11 +++++++++++ tools/travis/compile_and_run.sh | 2 +- tools/travis/install_build_deps.sh | 14 ++++++++++++++ tools/travis/install_byond.sh | 17 ++++++++++++----- 5 files changed, 49 insertions(+), 15 deletions(-) create mode 100644 _build_dependencies.sh create mode 100644 tools/travis/install_build_deps.sh diff --git a/.travis.yml b/.travis.yml index cea5f854c91..e8fc91b07e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,14 @@ #pretending we're C because otherwise ruby will initialize, even with "language: dm". language: c +dist: xenial env: global: - BASENAME="vorestation" # $BASENAME.dmb, $BASENAME.dme, etc. - - BYOND_MAJOR="513" - - BYOND_MINOR="1520" - - MACRO_COUNT=4 cache: directories: - - $HOME/BYOND-${BYOND_MAJOR}.${BYOND_MINOR} + - $HOME/BYOND addons: apt: @@ -37,13 +35,17 @@ jobs: include: - stage: "File Tests" #This is the odd man out, with specific installs and stuff. name: "Validate Files" - install: #Need python for some of the tag matching stuff - - pip install --user PyYaml -q - - pip install --user beautifulsoup4 -q - script: ./tools/travis/validate_files.sh addons: apt: - packages: ~ # Don't need any packages for this + packages: + - python3 + - python3-pip + - python3-setuptools + install: #Need python for some of the tag matching stuff + - tools/travis/install_build_deps.sh + script: + - tools/travis/validate_files.sh + - tools/travis/build_tgui.sh - stage: "Unit Tests" env: TEST_DEFINE="UNIT_TEST" TEST_FILE="code/_unit_tests.dm" RUN="1" name: "Compile normally (unit tests)" diff --git a/_build_dependencies.sh b/_build_dependencies.sh new file mode 100644 index 00000000000..bc251f876ab --- /dev/null +++ b/_build_dependencies.sh @@ -0,0 +1,11 @@ +# This file has all the information on what versions of libraries are thrown into the code +# For dreamchecker +export SPACEMANDMM_TAG=suite-1.4 +# For NanoUI + TGUI +export NODE_VERSION=12 +# For the scripts in tools +export PHP_VERSION=5.6 +# Byond Major +export BYOND_MAJOR=513 +# Byond Minor +export BYOND_MINOR=1526 \ No newline at end of file diff --git a/tools/travis/compile_and_run.sh b/tools/travis/compile_and_run.sh index fa3c382943e..65c2ed4d21d 100644 --- a/tools/travis/compile_and_run.sh +++ b/tools/travis/compile_and_run.sh @@ -3,7 +3,7 @@ RED='\033[0;31m' NC='\033[0m' -source $HOME/BYOND-${BYOND_MAJOR}.${BYOND_MINOR}/byond/bin/byondsetup +source $HOME/BYOND/byond/bin/byondsetup # Copy example configs cp config/example/* config/ diff --git a/tools/travis/install_build_deps.sh b/tools/travis/install_build_deps.sh new file mode 100644 index 00000000000..eab4e852013 --- /dev/null +++ b/tools/travis/install_build_deps.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -euo pipefail + +source _build_dependencies.sh + +source ~/.nvm/nvm.sh +nvm install $NODE_VERSION +nvm use $NODE_VERSION +npm install --global yarn + +pip install --user PyYaml -q +pip install --user beautifulsoup4 -q + +phpenv global $PHP_VERSION \ No newline at end of file diff --git a/tools/travis/install_byond.sh b/tools/travis/install_byond.sh index cca44342c60..0c22d4357d2 100644 --- a/tools/travis/install_byond.sh +++ b/tools/travis/install_byond.sh @@ -1,14 +1,21 @@ #!/bin/sh -set -e -if [ -d "$HOME/BYOND-${BYOND_MAJOR}.${BYOND_MINOR}/byond/bin" ]; +set -euo pipefail + +source _build_dependencies.sh + +if [ -d "$HOME/BYOND/byond/bin" ] && grep -Fxq "${BYOND_MAJOR}.${BYOND_MINOR}" $HOME/BYOND/version.txt; then echo "Using cached directory." else echo "Setting up BYOND." - mkdir -p "$HOME/BYOND-${BYOND_MAJOR}.${BYOND_MINOR}" - cd "$HOME/BYOND-${BYOND_MAJOR}.${BYOND_MINOR}" + rm -rf "$HOME/BYOND" + mkdir -p "$HOME/BYOND" + cd "$HOME/BYOND" curl "http://www.byond.com/download/build/${BYOND_MAJOR}/${BYOND_MAJOR}.${BYOND_MINOR}_byond_linux.zip" -o byond.zip unzip byond.zip + rm byond.zip cd byond make here -fi + echo "$BYOND_MAJOR.$BYOND_MINOR" > "$HOME/BYOND/version.txt" + cd ~/ +fi \ No newline at end of file