Merge remote-tracking branch 'ParadiseSS13/master' into nanoui-is-dead

This commit is contained in:
AffectedArc07
2020-11-21 16:23:58 +00:00
27 changed files with 138 additions and 170 deletions
+1 -2
View File
@@ -11,8 +11,7 @@
# CI + Tooling
/.github/workflows/ @AffectedArc07
/code/modules/unit_tests/ @AffectedArc07
/tools/travis/ @AffectedArc07
.travis.yml @AffectedArc07
/tools/ci/ @AffectedArc07
# Executables that need to be security-cleared
dreamchecker.exe @AffectedArc07
+2 -2
View File
@@ -597,8 +597,8 @@ pull requests/issues, and merging/closing pull requests.
matter how trivial. This is to ensure quality.
* A subset of this instruction: Do not push directly to the repository, always make a
pull request.
* Wait for the Travis CI build to complete. If it fails, the pull request may only be
merged if there is a very good reason (example: fixing the Travis configuration).
* Wait for the CI build to complete. If it fails, the pull request may only be
merged if there is a very good reason (example: fixing the CI configuration).
* Pull requests labeled as bugfixes and refactors may be merged as soon as they are
reviewed.
* The shortest waiting period for -any- feature or balancing altering pull request is 24
+87
View File
@@ -0,0 +1,87 @@
name: CI
on:
pull_request:
branches:
- master
jobs:
run_linters:
name: Run Linters
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Setup Cache
uses: actions/cache@v2
with:
path: $HOME/SpacemanDMM
key: ${{ runner.os }}-spacemandmm
- name: Install Tools
run: |
bash tools/ci/install_build_deps.sh
bash tools/ci/install_dreamchecker.sh
- name: Run Linters
run: |
find . -name "*.json" -not -path "*/node_modules/*" -print0 | xargs -0 python3 ./tools/ci/json_verifier.py
tools/ci/build_nanoui.sh
tools/ci/build_tgui.sh
tools/ci/check_grep.sh
python3 tools/ci/check_line_endings.py
~/dreamchecker > ${GITHUB_WORKSPACE}/output-annotations.txt 2>&1
- name: Annotate Lints
uses: yogstation13/DreamAnnotate@v1
if: always()
with:
outputFile: output-annotations.txt
compile_all_maps:
name: Compile All Maps
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Setup Cache
uses: actions/cache@v2
with:
path: $HOME/BYOND
key: ${{ runner.os }}-byond
- name: Compile All Maps
run: |
tools/ci/install_byond.sh
source $HOME/BYOND/byond/bin/byondsetup
tools/ci/generate_maplist.sh
tools/ci/dm.sh -Mci_map_testing paradise.dme
unit_tests_and_sql:
name: Unit Tests + SQL Validation
runs-on: ubuntu-18.04
services:
mysql:
image: mysql:latest
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306
options: --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 10
steps:
- uses: actions/checkout@v2
- name: Setup Cache
uses: actions/cache@v2
with:
path: $HOME/BYOND
key: ${{ runner.os }}-byond
- name: Setup & Validate DB
run: |
sudo systemctl start mysql
python3 tools/ci/generate_sql_scripts.py
tools/ci/validate_sql.sh
- name: Install RUST_G
run: |
sudo dpkg --add-architecture i386
sudo apt update || true
sudo apt install libssl1.1:i386
bash tools/ci/install_rustg.sh
- name: Compile & Run Unit Tests
run: |
tools/ci/install_byond.sh
tools/ci/install_rustg.sh
source $HOME/BYOND/byond/bin/byondsetup
tools/ci/dm.sh -DCIBUILDING paradise.dme
tools/ci/run_server.sh
-72
View File
@@ -1,72 +0,0 @@
language: generic
dist: bionic
os: linux
git:
depth: 1
jobs:
include:
- name: "Run Linters"
addons:
apt:
packages:
- python3
- python3-pip
- python3-setuptools
install:
- tools/travis/install_build_deps.sh
- tools/travis/install_dreamchecker.sh
script:
- find . -name "*.php" -print0 | xargs -0 -n1 php -l
- find . -name "*.json" -not -path "*/node_modules/*" -print0 | xargs -0 python3 ./tools/travis/json_verifier.py
- tools/travis/build_tgui.sh
- tools/travis/check_grep.sh
- python3 tools/travis/check_line_endings.py
- ~/dreamchecker
- name: "Compile All Maps"
addons:
apt:
packages:
- libstdc++6:i386
cache:
directories:
- $HOME/BYOND
install:
- tools/travis/install_byond.sh
- source $HOME/BYOND/byond/bin/byondsetup
script:
- tools/travis/generate_maplist.sh
- tools/travis/dm.sh -Mtravis_map_testing paradise.dme
- name: "Unit Tests + SQL Validation"
addons:
mariadb: '10.2'
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- python3
- libstdc++6:i386
- gcc-multilib
- pkg-config:i386
- zlib1g-dev:i386
- libssl1.1:i386
cache:
directories:
- $HOME/.cargo
- $HOME/.rustup
- $HOME/BYOND
before_install:
- 'sudo apt-get -qq update'
install:
- tools/travis/install_byond.sh
- tools/travis/install_rustg.sh
- source $HOME/BYOND/byond/bin/byondsetup
- python3 tools/travis/generate_sql_scripts.py
before_script:
- tools/travis/validate_sql.sh
script:
- tools/travis/dm.sh -DTRAVISBUILDING paradise.dme || travis_terminate 1
- tools/travis/run_server.sh
+15 -16
View File
@@ -1,5 +1,4 @@
# Paradise
[![Build Status](https://travis-ci.org/ParadiseSS13/Paradise.svg?branch=master)](https://travis-ci.org/ParadiseSS13/Paradise)
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/paradisess13/paradise.svg)](http://isitmaintained.com/project/paradisess13/paradise "Average time to resolve an issue")
[![Percentage of issues still open](http://isitmaintained.com/badge/open/paradisess13/paradise.svg)](http://isitmaintained.com/project/paradisess13/paradise "Percentage of issues still open")
![Render Nanomaps](https://github.com/ParadiseSS13/Paradise/workflows/Render%20Nanomaps/badge.svg)
@@ -17,9 +16,9 @@ The simplest way to obtain the code is using the github .zip feature.
Click [here](https://github.com/ParadiseSS13/Paradise/archive/master.zip) to get the latest code as a .zip file, then unzip it to wherever you want.
The more complicated and easier to update method is using git.
You'll need to download git or some client from [here](http://git-scm.com/).
When that's installed, right click in any folder and click on "Git Bash".
The more complicated and easier to update method is using git.
You'll need to download git or some client from [here](http://git-scm.com/).
When that's installed, right click in any folder and click on "Git Bash".
When that opens, type in:
git clone https://github.com/ParadiseSS13/Paradise.git
@@ -30,12 +29,12 @@ This will take a while to download, but it provides an easier method for updatin
### INSTALLATION
First-time installation should be fairly straightforward.
First, you'll need BYOND installed.
First-time installation should be fairly straightforward.
First, you'll need BYOND installed.
You can get it from [here](http://www.byond.com/).
This is a sourcecode-only release, so the next step is to compile the server files.
Open paradise.dme by double-clicking it, open the Build menu, and click compile.
This is a sourcecode-only release, so the next step is to compile the server files.
Open paradise.dme by double-clicking it, open the Build menu, and click compile.
This'll take a little while, and if everything's done right,
you'll get a message like this:
@@ -47,27 +46,27 @@ If you see any errors or warnings,
something has gone wrong - possibly a corrupt download or the files extracted wrong,
or a code issue on the main repo. Ask on IRC.
Once that's done, open up the config folder.
Once that's done, open up the config folder.
You'll want to edit config.txt to set your server location,
so that all your players don't get disconnected at the end of each round.
It's recommended you don't turn on the gamemodes with probability 0,
as they have various issues and aren't currently being tested,
so they may have unknown and bizarre bugs.
You'll also want to edit admins.txt to remove the default admins and add your own.
You'll also want to edit admins.txt to remove the default admins and add your own.
"Host" is the highest level of access, and the other recommended admin levels for now are
"Game Admin" and "Moderator". The format is:
byondkey - Rank
where the BYOND key must be in lowercase and the admin rank must be properly capitalised.
where the BYOND key must be in lowercase and the admin rank must be properly capitalised.
There are a bunch more admin ranks, but these two should be enough for most servers,
assuming you have trustworthy admins.
Finally, to start the server,
run Dream Daemon and enter the path to your compiled paradise.dmb file.
run Dream Daemon and enter the path to your compiled paradise.dmb file.
Make sure to set the port to the one you specified in the config.txt,
and set the Security box to 'Trusted'.
and set the Security box to 'Trusted'.
Then press GO and the server should start up and be ready to join.
### Installation (Linux)
@@ -109,10 +108,10 @@ For a basic setup, simply copy every file from config/example to config.
### SQL Setup
The SQL backend for the library and stats tracking requires a MySQL server.
The SQL backend for the library and stats tracking requires a MySQL server.
Your server details go in /config/dbconfig.txt,
and the SQL schema is in /SQL/paradise_schema.sql or /SQL/paradise_schema_prefix.sql,
depending on if you want table prefixes.
depending on if you want table prefixes.
More detailed setup instructions are located on our wiki:
https://www.paradisestation.org/wiki/index.php/Setting_up_the_Database
@@ -121,7 +120,7 @@ https://www.paradisestation.org/wiki/index.php/Setting_up_the_Database
### IRC Bot Setup
Included in the repo is an IRC bot capable of relaying adminhelps to a specified IRC
channel/server (thanks to Skibiliano).
channel/server (thanks to Skibiliano).
Instructions for bot setup are included in the /bot/ folder,
along with the bot/relay script itself.
-2
View File
@@ -3,8 +3,6 @@
export SPACEMANDMM_TAG=suite-1.6
# For TGUI
export NODE_VERSION=12
# For the scripts in tools
export PHP_VERSION=7.2
# Byond Major
export BYOND_MAJOR=513
# Byond Minor
-9
View File
@@ -1,9 +0,0 @@
version: '{build}'
skip_branch_with_pr: true
shallow_clone: true
build_script:
- ps: ./tools/appveyor/build.ps1
- ps: "$deployPath = $env:APPVEYOR_BUILD_FOLDER + '/deploy'; bash ./tools/appveyor/deploy.sh $deployPath"
- ps: "[System.IO.Compression.ZipFile]::CreateFromDirectory($env:APPVEYOR_BUILD_FOLDER + '/deploy', $env:APPVEYOR_BUILD_FOLDER + '/deploy.zip')"
artifacts:
- path: deploy.zip
+1 -1
View File
@@ -5,7 +5,7 @@
// #define UNIT_TESTS
#ifdef TRAVISBUILDING
#ifdef CIBUILDING
#define UNIT_TESTS
#endif
+3 -3
View File
@@ -1,9 +1,9 @@
// Unit test to check SQL version has been updated properly.,
/datum/unit_test/sql_version/Run()
// Check if the SQL version set in the code is equal to the travis DB config
// Check if the SQL version set in the code is equal to the CI DB config
if(config.sql_enabled && sql_version != SQL_VERSION)
Fail("SQL version error: Game is running V[SQL_VERSION] but config is V[sql_version]. You may need to update tools/travis/dbconfig.txt")
// Check if the travis DB config is up to date with the example dbconfig
Fail("SQL version error: Game is running V[SQL_VERSION] but config is V[sql_version]. You may need to update tools/ci/dbconfig.txt")
// Check if the CI DB config is up to date with the example dbconfig
// This proc is a little unclean but it works
var/example_db_version
var/list/Lines = file2list("config/example/dbconfig.txt")
-12
View File
@@ -1,12 +0,0 @@
$BYOND_MAJOR=512
$BYOND_MINOR=1427
if(!(Test-Path -Path "C:/byond")){
Invoke-WebRequest "http://www.byond.com/download/build/$BYOND_MAJOR/$BYOND_MAJOR.${BYOND_MINOR}_byond.zip" -o C:/byond.zip
[System.IO.Compression.ZipFile]::ExtractToDirectory("C:/byond.zip", "C:/")
Remove-Item C:/byond.zip
}
Set-Location $env:APPVEYOR_BUILD_FOLDER
&"C:/byond/bin/dm.exe" -max_errors 0 paradise.dme
exit $LASTEXITCODE
-21
View File
@@ -1,21 +0,0 @@
#First arg is path to where you want to deploy
#creates a work tree free of everything except what's necessary to run the game
mkdir -p \
$1/_maps \
$1/config \
$1/goon \
$1/strings \
if [ -d ".git" ]; then
# Control will enter here if $DIRECTORY exists.
mkdir -p $1/.git/logs
cp -r .git/logs/* $1/.git/logs/
fi
cp paradise.dmb paradise.rsc rust_g.dll $1/
cp -r _maps/* $1/_maps/
cp -r config/* $1/config/
cp -r goon/* $1/goon/
cp -r config/example/* $1/config/
cp -r strings/* $1/strings/
@@ -1,6 +1,6 @@
# Info
All scripts utilised by Travis CI should be placed into this folder for the sake of maintainability, and knowing where stuff is
All scripts utilised by CI should be placed into this folder for the sake of maintainability, and knowing where stuff is
# NOTE
Do not move the `dm.sh` script without **VERY** good reason, as the server backend relies on it for updating, and moving this file **WILL** break server updating, but make the server appear to still be updated. TLDR: Dont move it or break its existing functionality, without advancing changes to the server host.
@@ -1,4 +1,4 @@
# This exists solely as a DBconfig file for travis testing
# This exists solely as a DBconfig file for CI testing
# Dont use it ingame
# Remember to update this when you increase the SQL version! -aa
SQL_ENABLED
@@ -7,5 +7,5 @@ ADDRESS 127.0.0.1
PORT 3306
FEEDBACK_DATABASE feedback
FEEDBACK_TABLEPREFIX
FEEDBACK_LOGIN travis_sql
FEEDBACK_LOGIN ci_sql
FEEDBACK_PASSWORD not_a_strong_password
+9
View File
@@ -0,0 +1,9 @@
#!/bin/bash
set -euo pipefail
# This script loops through every subdir here to generate a list of all maps programatically to avoid the list getting out of date
cd _maps
find | grep -Ei ".dmm" | grep -v -e ".before" -e ".backup" > ci_map_testing.dm
sed -i -e 's/.*/#include \"&\"/' ci_map_testing.dm
echo "Generated map compile file with `wc -l ci_map_testing.dm` maps"
@@ -26,11 +26,11 @@ os.chdir("../../")
# Delete the testing directory IF it exists.
# This is what I mean by python being picky
if os.path.exists("tools/travis/sql_tmp") and os.path.isdir("tools/travis/sql_tmp"):
shutil.rmtree("tools/travis/sql_tmp")
if os.path.exists("tools/ci/sql_tmp") and os.path.isdir("tools/ci/sql_tmp"):
shutil.rmtree("tools/ci/sql_tmp")
# Now make the dir
os.mkdir("tools/travis/sql_tmp")
os.mkdir("tools/ci/sql_tmp")
# These lines will be used to generate a file which runs all the SQL scripts
# First we test from schema 0 all the way up to latest
@@ -39,7 +39,7 @@ os.mkdir("tools/travis/sql_tmp")
scriptLines = [
"#!/bin/bash\n",
"set -euo pipefail\n"
"mysql -u root < tools/travis/sql_v0.sql\n"
"mysql -u root -proot < tools/ci/sql_v0.sql\n"
]
# And write the files and tell them to be used
@@ -51,23 +51,23 @@ for file in orderedSqlFiles:
fileLines.insert(0, "USE `feedback`;\n")
# Write new files to be used by the testing script
outFile = open("tools/travis/sql_tmp/" + file, "w+")
outFile = open("tools/ci/sql_tmp/" + file, "w+")
outFile.writelines(fileLines)
outFile.close()
# Add a line to the script being made that tells it to use this SQL file
scriptLines.append("mysql -u root < tools/travis/sql_tmp/" + str(file) + "\n")
scriptLines.append("mysql -u root -proot < tools/ci/sql_tmp/" + str(file) + "\n")
scriptLines.append("mysql -u root -e 'DROP DATABASE feedback;'\n")
scriptLines.append("mysql -u root < SQL/paradise_schema_prefixed.sql\n")
scriptLines.append("mysql -u root -e 'DROP DATABASE feedback;'\n")
scriptLines.append("mysql -u root < SQL/paradise_schema.sql\n")
scriptLines.append("mysql -u root -e 'GRANT ALL on feedback.* TO `travis_sql`@`127.0.0.1` IDENTIFIED BY \"not_a_strong_password\";'\n")
scriptLines.append("mysql -u root -proot -e 'DROP DATABASE feedback;'\n")
scriptLines.append("mysql -u root -proot < SQL/paradise_schema_prefixed.sql\n")
scriptLines.append("mysql -u root -proot -e 'DROP DATABASE feedback;'\n")
scriptLines.append("mysql -u root -proot < SQL/paradise_schema.sql\n")
scriptLines.append("mysql -u root -proot -e 'GRANT ALL on feedback.* TO `ci_sql`@`127.0.0.1` IDENTIFIED BY \"not_a_strong_password\";'\n")
outputScript = open("tools/travis/validate_sql.sh", "w+")
outputScript = open("tools/ci/validate_sql.sh", "w+")
outputScript.writelines(scriptLines)
outputScript.close()
st = os.stat('tools/travis/validate_sql.sh')
os.chmod('tools/travis/validate_sql.sh', st.st_mode | stat.S_IEXEC)
st = os.stat('tools/ci/validate_sql.sh')
os.chmod('tools/ci/validate_sql.sh', st.st_mode | stat.S_IEXEC)
print("SQL validation script written successfully")
@@ -8,4 +8,3 @@ nvm install $NODE_VERSION
nvm use $NODE_VERSION
npm install --global yarn
phpenv global $PHP_VERSION
@@ -5,7 +5,7 @@ cp config/example/* config/
#Apply test DB config for SQL connectivity
rm config/dbconfig.txt
cp tools/travis/dbconfig.txt config
cp tools/ci/dbconfig.txt config
# Now run the server and the unit tests
DreamDaemon paradise.dmb -close -trusted -verbose
@@ -1,5 +1,5 @@
# This file is revision 0 of the server SQL schema
# It is intended ONLY for travis testing, and thus has data thrown in to test all update files with
# It is intended ONLY for CI testing, and thus has data thrown in to test all update files with
# DO NOT SET THIS AS THE GAMES PROPER SCHEMA OR A LOT OF STUFF WILL BREAK
-- --------------------------------------------------------
@@ -459,7 +459,7 @@ CREATE TABLE IF NOT EXISTS `poll_textreply` (
-- Dumping data for table feedback.poll_textreply: ~0 rows (approximately)
/*!40000 ALTER TABLE `poll_textreply` DISABLE KEYS */;
INSERT INTO `poll_textreply` (`id`, `datetime`, `pollid`, `ckey`, `ip`, `replytext`, `adminrank`) VALUES
(1, '2020-04-24 18:05:42', 1, 'AffectedArc07', '127.0.0.1', 'This is far too much work for a travis rework', 'Player');
(1, '2020-04-24 18:05:42', 1, 'AffectedArc07', '127.0.0.1', 'This is far too much work for a CI rework', 'Player');
/*!40000 ALTER TABLE `poll_textreply` ENABLE KEYS */;
-- Dumping structure for table feedback.poll_vote
-9
View File
@@ -1,9 +0,0 @@
#!/bin/bash
set -euo pipefail
# This script loops through every subdir here to generate a list of all maps programatically to avoid the list getting out of date
cd _maps
find | grep -Ei ".dmm" | grep -v -e ".before" -e ".backup" > travis_map_testing.dm
sed -i -e 's/.*/#include \"&\"/' travis_map_testing.dm
echo "Generated map compile file with `wc -l travis_map_testing.dm` maps"