Skip to content
This repository was archived by the owner on Sep 26, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 59 additions & 36 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,93 @@
language: generic
dist: xenial
sudo: false

branches:
except:
- ___TGS3TempBranch
- ___TGSTempBranch

matrix:
include:
- env:
- BUILD_TOOLS=true
name: "Build Tools"
- name: "Run Linters"
addons:
apt:
packages:
- python3
- python3-pip
cache:
directories:
- tgui/node_modules
- env:
- BUILD_TESTING=true
- BUILD_TOOLS=false
name: "Build All Maps"
- python3-setuptools
install:
- tools/travis/install_build_tools.sh
- tools/travis/install_spaceman_dmm.sh dreamchecker
script:
- tools/travis/check_filedirs.sh tgstation.dme
- tools/travis/check_changelogs.sh
- find . -name "*.php" -print0 | xargs -0 -n1 php -l
- find . -name "*.json" -not -path "./tgui/node_modules/*" -print0 | xargs -0 python3 ./tools/json_verifier.py
- tools/travis/build_tgui.sh
- tools/travis/check_grep.sh
- ~/dreamchecker

- name: "Compile All Maps"
addons:
apt:
packages:
- libstdc++6:i386
cache:
directories:
- $HOME/BYOND
- env:
- BUILD_TESTING=false
- BUILD_TOOLS=false
name: "Build and Run Unit Tests"
install:
- tools/travis/install_byond.sh
- source $HOME/BYOND/byond/bin/byondsetup
before_script:
- tools/travis/template_dm_generator.py
script:
- tools/travis/dm.sh -DTRAVISBUILDING -DTRAVISTESTING -DALL_MAPS tgstation.dme

- name: "Compile and Run Tests"
addons:
mariadb: '10.2'
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libstdc++6:i386
- libssl-dev:i386
- gcc-multilib
- g++-7
- g++-7-multilib
- libmariadbclient-dev:i386
- libmariadb-client-lgpl-dev:i386
- libmariadbd-dev
cache:
directories:
- $HOME/.cargo
- $HOME/BYOND
- $HOME/MariaDB
- $HOME/.rustup

install:
- tools/travis/install_build_tools.sh
- if [ $BUILD_TOOLS = false ] && [ $BUILD_TESTING = false ]; then mysql -u root -e 'CREATE DATABASE tg_travis;'; fi
- if [ $BUILD_TOOLS = false ] && [ $BUILD_TESTING = false ]; then mysql -u root tg_travis < SQL/tgstation_schema.sql; fi
- if [ $BUILD_TOOLS = false ] && [ $BUILD_TESTING = false ]; then mysql -u root -e 'CREATE DATABASE tg_travis_prefixed;'; fi
- if [ $BUILD_TOOLS = false ] && [ $BUILD_TESTING = false ]; then mysql -u root tg_travis_prefixed < SQL/tgstation_schema_prefixed.sql; fi

before_script:
- tools/travis/before_build_tools.sh
- tools/travis/before_build_byond.sh

script:
- tools/travis/check_filedirs.sh DeepSpace13.dme
- tools/travis/build_tools.sh || travis_terminate 1
- tools/travis/build_dependencies.sh || travis_terminate 1
- tools/travis/build_byond.sh
- $HOME/libmariadb
install:
- tools/travis/install_byond.sh
- source $HOME/BYOND/byond/bin/byondsetup
- tools/travis/install_libmariadb.sh
- tools/travis/install_rust_g.sh
before_script:
- mysql -u root -e 'CREATE DATABASE tg_travis;'
- mysql -u root tg_travis < SQL/tgstation_schema.sql
- mysql -u root -e 'CREATE DATABASE tg_travis_prefixed;'
- mysql -u root tg_travis_prefixed < SQL/tgstation_schema_prefixed.sql
- tools/travis/build_bsql.sh
script:
- tools/travis/dm.sh -DTRAVISBUILDING tgstation.dme || travis_terminate 1
- tools/travis/run_server.sh

- name: "Generate Documentation"
# Only run for non-PR commits to the real master branch.
if: branch = master AND head_branch IS blank
install:
- tools/travis/install_spaceman_dmm.sh dmdoc
before_script:
# Travis checks out a hash, try to get back on a branch.
- git checkout $TRAVIS_BRANCH || true
script:
- ~/dmdoc
deploy:
provider: pages
skip_cleanup: true
local_dir: dmdoc
github_token: $DMDOC_GITHUB_TOKEN
7 changes: 0 additions & 7 deletions tools/travis/before_build_tools.sh

This file was deleted.

21 changes: 21 additions & 0 deletions tools/travis/build_bsql.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -euo pipefail

source dependencies.sh

mkdir -p BSQL
cd BSQL
git init
git remote add origin https://github.com/tgstation/BSQL
git fetch --depth 1 origin $BSQL_VERSION
git checkout FETCH_HEAD

mkdir -p artifacts
cd artifacts
export CXX=g++-7
# The -D will be unnecessary past BSQL v1.4.0.0
cmake .. -DMARIA_LIBRARY=/usr/lib/i386-linux-gnu/libmariadb.so
make

mkdir -p ~/.byond/bin
ln -s $PWD/src/BSQL/libBSQL.so ../../libBSQL.so
80 changes: 0 additions & 80 deletions tools/travis/build_byond.sh

This file was deleted.

64 changes: 0 additions & 64 deletions tools/travis/build_dependencies.sh

This file was deleted.

7 changes: 7 additions & 0 deletions tools/travis/build_tgui.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
set -euo pipefail

cd tgui
source ~/.nvm/nvm.sh
npm ci
node node_modules/gulp/bin/gulp.js --min
16 changes: 0 additions & 16 deletions tools/travis/build_tools.sh

This file was deleted.

5 changes: 5 additions & 0 deletions tools/travis/check_changelogs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -euo pipefail

md5sum -c - <<< "49bc6b1b9ed56c83cceb6674bd97cb34 *html/changelogs/example.yml"
python3 tools/ss13_genchangelog.py html/changelog.html html/changelogs
49 changes: 49 additions & 0 deletions tools/travis/check_grep.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash
set -euo pipefail

#nb: must be bash to support shopt globstar
shopt -s globstar

st=0

if grep -El '^\".+\" = \(.+\)' _maps/**/*.dmm; then
echo "Non-TGM formatted map detected. Please convert it using Map Merger!"
st=1
fi;
if grep -P '^\ttag = \"icon' _maps/**/*.dmm; then
echo "tag vars from icon state generation detected in maps, please remove them."
st=1
fi;
if grep 'step_[xy]' _maps/**/*.dmm; then
echo "step_x/step_y variables detected in maps, please remove them."
st=1
fi;
if grep 'pixel_[xy] = 0' _maps/**/*.dmm; then
echo "pixel_x/pixel_y = 0 variables detected in maps, please review to ensure they are not dirty varedits."
fi;
if grep -P '\td[1-2] =' _maps/**/*.dmm; then
echo "d1/d2 cable variables detected in maps, please remove them."
st=1
fi;
if grep '^/area/.+[\{]' _maps/**/*.dmm; then
echo "Vareditted /area path use detected in maps, please replace with proper paths."
st=1
fi;
if grep '\W\/turf\s*[,\){]' _maps/**/*.dmm; then
echo "base /turf path use detected in maps, please replace with proper paths."
st=1
fi;
if grep '^/*var/' code/**/*.dm; then
echo "Unmanaged global var use detected in code, please use the helpers."
st=1
fi;
if grep -i 'centcomm' code/**/*.dm; then
echo "Misspelling(s) of CENTCOM detected in code, please remove the extra M(s)."
st=1
fi;
if grep -i 'centcomm' _maps/**/*.dmm; then
echo "Misspelling(s) of CENTCOM detected in maps, please remove the extra M(s)."
st=1
fi;

exit $st
Loading