Skip to content

Commit

Permalink
Merge pull request #3 from EgorDinamit/fix-issue
Browse files Browse the repository at this point in the history
Fixes certain tool issues
  • Loading branch information
EgorDinamit authored Jan 22, 2024
2 parents 70fea7d + e53d14b commit fa5adaa
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 22 deletions.
59 changes: 52 additions & 7 deletions .github/workflows/ci_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,28 @@ jobs:
if: "!contains(github.event.head_commit.message, '[ci skip]')"
name: Run Linters
runs-on: ubuntu-20.04
env:
TG_BOOTSTRAP_NODE_LINUX: 1
steps:
- uses: actions/checkout@v2
- name: Setup cache
- name: Setup SpacemanDMM cache
uses: actions/cache@v2
with:
path: $HOME/SpacemanDMM
key: ${{ runner.os }}-spacemandmm
- name: Setup bootstrap cache
uses: actions/cache@v2
with:
path: tools/bootstrap/.cache
key: ${{ runner.os }}-bootstrap
- name: Setup yarn cache
uses: actions/cache@v2
with:
path: tgui/.yarn/cache
key: ${{ runner.os }}-yarn
- name: Install Tools
run: |
pip3 install setuptools
bash tools/ci/install_node.sh
bash tools/ci/install_spaceman_dmm.sh dreamchecker
tools/bootstrap/python -c ''
- name: Run Linters
Expand All @@ -31,29 +42,39 @@ jobs:
find . -name "*.php" -print0 | xargs -0 -n1 php -l
find . -name "*.json" -not -path "*/node_modules/*" -print0 | xargs -0 python3 ./tools/json_verifier.py
tgui/bin/tgui --lint
tgui/bin/tgui --test
bash tools/ci/check_grep.sh
tools/bootstrap/python -m dmi.test
tools/bootstrap/python -m mapmerge2.dmm_test
~/dreamchecker > ${GITHUB_WORKSPACE}/output-annotations.txt 2>&1
- name: Annotate Lints
uses: yogstation13/DreamAnnotate@v1
uses: yogstation13/DreamAnnotate@v2
if: always()
with:
outputFile: output-annotations.txt


compile_all_maps:
if: "!contains(github.event.head_commit.message, '[ci skip]')"
name: Compile Maps
runs-on: ubuntu-20.04
env:
TG_BOOTSTRAP_NODE_LINUX: 1
steps:
- uses: actions/checkout@v2
- name: Setup cache
- name: Setup BYOND cache
uses: actions/cache@v2
with:
path: $HOME/BYOND
key: ${{ runner.os }}-byond
- name: Setup bootstrap cache
uses: actions/cache@v2
with:
path: tools/bootstrap/.cache
key: ${{ runner.os }}-bootstrap
- name: Setup yarn cache
uses: actions/cache@v2
with:
path: tgui/.yarn/cache
key: ${{ runner.os }}-yarn
- name: Compile All Maps
run: |
bash tools/ci/install_byond.sh
Expand All @@ -66,6 +87,8 @@ jobs:
if: "!contains(github.event.head_commit.message, '[ci skip]')"
name: Integration Tests
runs-on: ubuntu-20.04
env:
TG_BOOTSTRAP_NODE_LINUX: 1
services:
mysql:
image: mysql:latest
Expand All @@ -76,11 +99,21 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v2
- name: Setup cache
- name: Setup BYOND cache
uses: actions/cache@v2
with:
path: $HOME/BYOND
key: ${{ runner.os }}-byond
- name: Setup bootstrap cache
uses: actions/cache@v2
with:
path: tools/bootstrap/.cache
key: ${{ runner.os }}-bootstrap
- name: Setup yarn cache
uses: actions/cache@v2
with:
path: tgui/.yarn/cache
key: ${{ runner.os }}-yarn
- name: Setup database
run: |
sudo systemctl start mysql
Expand Down Expand Up @@ -108,6 +141,18 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup bootstrap cache
uses: actions/cache@v2
with:
path: tools/bootstrap/.cache
key: ${{ runner.os }}-bootstrap
- name: Setup yarn cache
uses: actions/cache@v2
with:
path: tgui/.yarn/cache
key: ${{ runner.os }}-yarn
- name: Bootstrap node
run: pwsh tools/bootstrap/node_.ps1
- name: Compile
run: pwsh tools/ci/build.ps1
- name: Create artifact
Expand Down
8 changes: 8 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
"name": "Launch DreamSeeker",
"preLaunchTask": "Build All",
"dmb": "${workspaceFolder}/${command:CurrentDMB}"
},
{
"type": "byond",
"request": "launch",
"name": "Launch DreamDaemon",
"preLaunchTask": "Build All",
"dmb": "${workspaceFolder}/${command:CurrentDMB}",
"dreamDaemon": true
}
]
}
6 changes: 6 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"kind": "build",
"isDefault": true
},
"dependsOn": "dm: reparse",
"label": "Build All"
},
{
Expand All @@ -44,6 +45,11 @@
],
"group": "build",
"label": "tgui: build"
},
{
"command": "${command:dreammaker.reparse}",
"group": "build",
"label": "dm: reparse"
}
]
}
8 changes: 4 additions & 4 deletions dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
#Final authority on what's required to fully build the project

# byond version
export BYOND_MAJOR=513
export BYOND_MINOR=1536
export BYOND_MAJOR=514
export BYOND_MINOR=1589

#rust_g git tag
export RUST_G_VERSION=0.4.7

#node version
export NODE_VERSION=12
export NODE_VERSION_PRECISE=12.20.0
export NODE_VERSION=14
export NODE_VERSION_PRECISE=14.16.1

# SpacemanDMM git tag
export SPACEMAN_DMM_VERSION=suite-1.6
Expand Down
8 changes: 1 addition & 7 deletions tools/bootstrap/node.bat
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
@echo off
where node.exe >nul 2>nul
if %errorlevel% == 0 (
echo | set /p printed_str="Using system-wide Node "
call node.exe --version
call node.exe %*
exit /b %errorlevel%
)
set NODE_SKIP_PLATFORM_CHECK=1
call powershell -NoLogo -ExecutionPolicy Bypass -File "%~dp0\node_.ps1" Download-Node
for /f "tokens=* USEBACKQ" %%s in (`
call powershell -NoLogo -ExecutionPolicy Bypass -File "%~dp0\node_.ps1" Get-Path
Expand Down
7 changes: 4 additions & 3 deletions tools/bootstrap/node_.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ function Download-Node {
Write-Output "Downloading Node v$NodeVersion"
New-Item $NodeTargetDir -ItemType Directory -ErrorAction silentlyContinue | Out-Null
$WebClient = New-Object Net.WebClient
$WebClient.DownloadFile($NodeSource, $NodeTarget)
$WebClient.DownloadFile($NodeSource, "$NodeTarget.downloading")
Rename-Item "$NodeTarget.downloading" $NodeTarget
}

## Convenience variables
Expand All @@ -30,8 +31,8 @@ if ($Env:TG_BOOTSTRAP_CACHE) {
$Cache = $Env:TG_BOOTSTRAP_CACHE
}
$NodeVersion = Extract-Variable -Path "$BaseDir\..\..\dependencies.sh" -Key "NODE_VERSION_PRECISE"
$NodeSource = "https://nodejs.org/download/release/v$NodeVersion/win-x86/node.exe"
$NodeTargetDir = "$Cache\node-v$NodeVersion"
$NodeSource = "https://nodejs.org/download/release/v$NodeVersion/win-x64/node.exe"
$NodeTargetDir = "$Cache\node-v$NodeVersion-win-x64"
$NodeTarget = "$NodeTargetDir\node.exe"

## Just print the path and exit
Expand Down
Empty file modified tools/build/build
100644 → 100755
Empty file.
1 change: 0 additions & 1 deletion tools/ci/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ if(!(Test-Path -Path "C:/byond")){
Remove-Item C:/byond.zip
}

bash tools/ci/install_node.sh
bash tgui/bin/tgui --build

&"C:/byond/bin/dm.exe" -max_errors 0 tgstation.dme
Expand Down
3 changes: 3 additions & 0 deletions tools/ci/ci_maps.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
map metastation
default
endmap
2 changes: 2 additions & 0 deletions tools/ci/run_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ mkdir ci_test/config

#test config
cp tools/ci/ci_config.txt ci_test/config/config.txt
#so that we get the right default map
cp tools/ci/ci_maps.txt ci_test/config/maps.txt

cd ci_test
DreamDaemon tgstation.dmb -close -trusted -verbose -params "log-directory=ci"
Expand Down

0 comments on commit fa5adaa

Please sign in to comment.