Redoes CI + removes RUSTG from the repo (#23490)

* Redoes CI + removes RUSTG from the repo

* We need these

* Split these out

* Why does every CI PR end like this

* Agh

* Fun

* Even more shit

* Try this

* Lets bump this
This commit is contained in:
AffectedArc07
2023-12-08 17:05:08 +01:00
committed by GitHub
parent 3afd8e4d05
commit 4ccd0b453f
10 changed files with 112 additions and 12 deletions
+7 -6
View File
@@ -10,7 +10,7 @@ on:
jobs:
run_linters:
name: Run Linters
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup Cache
@@ -47,7 +47,7 @@ jobs:
odlint:
name: Lint with OpenDream
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup OD
@@ -59,7 +59,7 @@ jobs:
compile_all_maps:
name: Compile All Maps
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup Cache
@@ -76,7 +76,7 @@ jobs:
unit_tests_and_sql:
name: Unit Tests + SQL Validation
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false # Let all map tests run to completion
matrix:
@@ -106,8 +106,9 @@ jobs:
run: |
sudo dpkg --add-architecture i386
sudo apt update || true
sudo apt install libssl1.1:i386
ldd librust_g.so
sudo apt install lib32z1 git pkg-config libssl-dev:i386 libssl-dev zlib1g-dev:i386 curl gcc libdbus-1-dev
sudo apt install gcc:i386
tools/ci/install_rustg.sh
- name: Compile & Run Unit Tests
run: |
tools/ci/install_byond.sh '${{ matrix.byondtype }}'
+5
View File
@@ -58,4 +58,9 @@ __pycache__/
dmm-tools.exe
OpenDream
paradise.json
# Misc windows shenanigans
$RECYCLE.BIN
# Linux libs
/*.so
+21
View File
@@ -0,0 +1,21 @@
# This file is used by TGS (https://github.com/tgstation/tgstation-server) clients to quickly initialize a server instance for the codebase
# The format isn't documented anywhere but hopefully we never have to change it. If there are questions, contact the TGS maintainer Cyberboss/@Dominion#0444
version: 1
# The BYOND version to use
# Must be interpreted as a string, keep quoted
byond: "515.1620"
# Folders to create in "<instance_path>/Configuration/GameStaticFiles/"
static_files:
# Config directory should be static
- name: config
# This implies the folder should be pre-populated with contents from the repo
populate: true
# Data directory must be static
- name: data
# Scripts linux needs
linux_scripts:
PreCompile.sh: tools/tgs_scripts/PreCompile.sh
WatchdogLaunch.sh: tools/tgs_scripts/WatchdogLaunch.sh
InstallDeps.sh: tools/tgs_scripts/InstallDeps.sh
# The security level the game should be run at
security: Trusted
+4 -2
View File
@@ -6,10 +6,12 @@ export NODE_VERSION=18
# Stable Byond Major
export STABLE_BYOND_MAJOR=515
# Stable Byond Minor
export STABLE_BYOND_MINOR=1619
export STABLE_BYOND_MINOR=1620
# Beta Byond Major
export BETA_BYOND_MAJOR=515
# Beta Byond Minor
export BETA_BYOND_MINOR=1619
export BETA_BYOND_MINOR=1620
# Python version for mapmerge and other tools
export PYTHON_VERSION=3.11.6
# RUSTG version
export RUSTG_VERSION=v3.0.0-P
+1 -1
View File
@@ -12,7 +12,7 @@ GLOBAL_DATUM(test_runner, /datum/test_runner)
SSmetrics.world_init_time = REALTIMEOFDAY
// Do sanity checks to ensure RUST actually exists
if(!fexists(RUST_G))
if((!fexists(RUST_G)) && world.system_type == MS_WINDOWS)
DIRECT_OUTPUT(world.log, "ERROR: RUSTG was not found and is required for the game to function. Server will now exit.")
del(world)
BIN
View File
Binary file not shown.
+1 -3
View File
@@ -1,11 +1,9 @@
#!/usr/bin/env bash
set -euo pipefail
# This script is not actually used by CI, but kept as a reference incase we refactor CI again
source _build_dependencies.sh
mkdir -p ~/.byond/bin
wget -O ~/.byond/bin/librust_g.so "https://github.com/ParadiseSS13/rust-g/releases/download/$RUSTG_VERSION/librust_g.so"
wget -O ~/.byond/bin/librust_g.so "https://github.com/ParadiseSS13/rust-g/releases/download/$RUSTG_VERSION/librust_g-ci.so"
chmod +x ~/.byond/bin/librust_g.so
ldd ~/.byond/bin/librust_g.so
+34
View File
@@ -0,0 +1,34 @@
#!/bin/bash
#find out what we have (+e is important for this)
set +e
has_git="$(command -v git)"
has_curl="$(command -v curl)"
has_cargo="$(command -v ~/.cargo/bin/cargo)"
has_sudo="$(command -v sudo)"
set -e
set -x
# apt packages, libssl needed by rust-g but not included in TGS barebones install
# These basically only work on ubuntu+debian
if ! ( [ -x "$has_git" ] && [ -x "$has_curl" ] && [ -f "/usr/lib/i386-linux-gnu/libssl.so" ] ); then
echo "Installing apt dependencies..."
if ! [ -x "$has_sudo" ]; then
dpkg --add-architecture i386
apt-get update
apt-get install -y lib32z1 git pkg-config libssl-dev:i386 libssl-dev zlib1g-dev:i386 curl gcc libdbus-1-dev
apt-get install -y gcc:i386
else
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y lib32z1 git pkg-config libssl-dev:i386 libssl-dev zlib1g-dev:i386 curl gcc libdbus-1-dev
sudo apt-get install -y gcc:i386
fi
fi
# install cargo if needed
if ! [ -x "$has_cargo" ]; then
echo "Installing rust..."
curl https://sh.rustup.rs -sSf | sh -s -- -y
. ~/.profile
fi
+33
View File
@@ -0,0 +1,33 @@
#!/bin/bash
./InstallDeps.sh
set -e
set -x
#load dep exports
#need to switch to game dir for Dockerfile weirdness
original_dir=$PWD
cd "$1"
. dependencies.sh
cd "$original_dir"
# update rust-g
if [ ! -d "rust-g" ]; then
echo "Cloning rust-g..."
git clone https://github.com/tgstation/rust-g
cd rust-g
~/.cargo/bin/rustup target add i686-unknown-linux-gnu
else
echo "Fetching rust-g..."
cd rust-g
git fetch
~/.cargo/bin/rustup target add i686-unknown-linux-gnu
fi
echo "Deploying rust-g..."
git checkout "$RUST_G_VERSION"
env PKG_CONFIG_ALLOW_CROSS=1 ~/.cargo/bin/cargo build --release --features all --target=i686-unknown-linux-gnu
mv target/i686-unknown-linux-gnu/release/librust_g.so "$1/librust_g.so"
cd ..
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
# Special file to ensure all dependencies still exist between server launches.
# Mainly for use by people who abuse docker by modifying the container's system.
./InstallDeps.sh