Skip to content

Commit 789f402

Browse files
Djiqstylemistake
andauthored
Juke and JS version bump with github CI stuff (#344)
* Juke Build 0.8.1 (#60404) * Juke Build 0.8.1 Hotfix 1 (#60897) * Juke Build 0.8.1 Hotfix 1 * Do not restore Yarn cache on just DM build * Improve Yarn caching in CI suite (#60962) * cache and checkout v3 * nodejs * bump --------- Co-authored-by: Aleksej Komarov <[email protected]>
1 parent 3a2c348 commit 789f402

File tree

22 files changed

+5274
-7153
lines changed

22 files changed

+5274
-7153
lines changed

.github/workflows/ci_suite.yml

Lines changed: 49 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,20 @@ jobs:
1212
name: Run Linters
1313
runs-on: ubuntu-20.04
1414
steps:
15-
- uses: actions/checkout@v2
16-
- name: Setup cache
17-
uses: actions/cache@v2
15+
- uses: actions/checkout@v3
16+
- name: Restore SpacemanDMM cache
17+
uses: actions/cache@v3
1818
with:
1919
path: ~/SpacemanDMM
20-
key: ${{ runner.os }}-spacemandmm-${{ secrets.CACHE_PURGE_KEY }}
20+
key: ${{ runner.os }}-spacemandmm
21+
- name: Restore Yarn cache
22+
uses: actions/cache@v3
23+
with:
24+
path: tgui/.yarn/cache
25+
key: ${{ runner.os }}-yarn-${{ hashFiles('tgui/yarn.lock') }}
26+
restore-keys: |
27+
${{ runner.os }}-build-
28+
${{ runner.os }}-
2129
- name: Install Tools
2230
run: |
2331
pip3 install setuptools
@@ -28,11 +36,9 @@ jobs:
2836
run: |
2937
bash tools/ci/check_filedirs.sh tgstation.dme
3038
bash tools/ci/check_changelogs.sh
31-
find . -name "*.php" -print0 | xargs -0 -n1 php -l
32-
find . -name "*.json" -not -path "*/node_modules/*" -print0 | xargs -0 python3 ./tools/json_verifier.py
33-
tgui/bin/tgui --lint
34-
tgui/bin/tgui --test
3539
bash tools/ci/check_grep.sh
40+
bash tools/ci/check_misc.sh
41+
tools/build/build --ci lint
3642
tools/bootstrap/python -m dmi.test
3743
tools/bootstrap/python -m mapmerge2.dmm_test
3844
~/dreamchecker > ${GITHUB_WORKSPACE}/output-annotations.txt 2>&1
@@ -47,18 +53,17 @@ jobs:
4753
name: Compile Maps
4854
runs-on: ubuntu-20.04
4955
steps:
50-
- uses: actions/checkout@v2
51-
- name: Setup cache
52-
uses: actions/cache@v2
56+
- uses: actions/checkout@v3
57+
- name: Restore BYOND cache
58+
uses: actions/cache@v3
5359
with:
5460
path: ~/BYOND
55-
key: ${{ runner.os }}-byond-${{ secrets.CACHE_PURGE_KEY }}
61+
key: ${{ runner.os }}-byond
5662
- name: Compile All Maps
5763
run: |
5864
bash tools/ci/install_byond.sh
5965
source $HOME/BYOND/byond/bin/byondsetup
60-
python3 tools/ci/template_dm_generator.py
61-
tools/build/build dm -DCIBUILDING -DCITESTING -DALL_MAPS
66+
tools/build/build --ci dm -DCIBUILDING -DCITESTING -DALL_MAPS
6267
6368
run_all_tests:
6469
if: "!contains(github.event.head_commit.message, '[ci skip]')"
@@ -73,12 +78,24 @@ jobs:
7378
- 3306
7479
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
7580
steps:
76-
- uses: actions/checkout@v2
77-
- name: Setup cache
78-
uses: actions/cache@v2
81+
- uses: actions/checkout@v3
82+
- name: Use Node.js 14.16.1
83+
uses: actions/setup-node@v3
84+
with:
85+
node-version: 14.16.1
86+
- name: Restore BYOND cache
87+
uses: actions/cache@v3
7988
with:
8089
path: ~/BYOND
81-
key: ${{ runner.os }}-byond-${{ secrets.CACHE_PURGE_KEY }}
90+
key: ${{ runner.os }}-byond
91+
- name: Restore Yarn cache
92+
uses: actions/cache@v3
93+
with:
94+
path: tgui/.yarn/cache
95+
key: ${{ runner.os }}-yarn-${{ hashFiles('tgui/yarn.lock') }}
96+
restore-keys: |
97+
${{ runner.os }}-build-
98+
${{ runner.os }}-
8299
- name: Setup database
83100
run: |
84101
sudo systemctl start mysql
@@ -96,15 +113,27 @@ jobs:
96113
run: |
97114
bash tools/ci/install_byond.sh
98115
source $HOME/BYOND/byond/bin/byondsetup
99-
tools/build/build -DCIBUILDING
116+
tools/build/build --ci -DCIBUILDING
100117
bash tools/ci/run_server.sh
101118
102119
test_windows:
103120
if: "!contains(github.event.head_commit.message, '[ci skip]')"
104121
name: Windows Build
105122
runs-on: windows-latest
106123
steps:
107-
- uses: actions/checkout@v2
124+
- uses: actions/checkout@v3
125+
- name: Use Node.js 14.16.1
126+
uses: actions/setup-node@v3
127+
with:
128+
node-version: 14.16.1
129+
- name: Restore Yarn cache
130+
uses: actions/cache@v3
131+
with:
132+
path: tgui/.yarn/cache
133+
key: ${{ runner.os }}-yarn-${{ hashFiles('tgui/yarn.lock') }}
134+
restore-keys: |
135+
${{ runner.os }}-build-
136+
${{ runner.os }}-
108137
- name: Compile
109138
run: pwsh tools/ci/build.ps1
110139
env:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@
1212

1313
#Ignore compiled files and other files generated during compilation.
1414
*.mdme
15+
*.mdme.*
1516
*.dmb
1617
*.rsc
18+
*.m.dme
19+
*.test.dme
1720
*.lk
1821
*.int
1922
*.backup

CLEAN.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
call "%~dp0\tools\build\build.bat" dist-clean
3+
pause

RUN_SERVER.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
call "%~dp0\tools\build\build.bat" server %*
3+
pause

dependencies.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ export BYOND_MINOR=1556
1111
export RUST_G_VERSION=0.5.0
1212

1313
#node version
14-
export NODE_VERSION=12
15-
export NODE_VERSION_PRECISE=12.20.0
14+
export NODE_VERSION=14
15+
export NODE_VERSION_PRECISE=14.16.1
1616

1717
# SpacemanDMM git tag
1818
export SPACEMAN_DMM_VERSION=suite-1.7

tgui/bin/tgui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ task-clean() {
9292
rm -f .yarn/build-state.yml
9393
rm -f .yarn/install-state.gz
9494
rm -f .yarn/install-target
95-
rm -f .pnp.js
95+
rm -f .pnp.*
9696
## NPM artifacts
9797
rm -rf **/node_modules
9898
rm -f **/package-lock.json

tgui/bin/tgui_.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function task-clean {
7575
Remove-Quiet -Force ".yarn\build-state.yml"
7676
Remove-Quiet -Force ".yarn\install-state.gz"
7777
Remove-Quiet -Force ".yarn\install-target"
78-
Remove-Quiet -Force ".pnp.js"
78+
Remove-Quiet -Force ".pnp.*"
7979
## NPM artifacts
8080
Get-ChildItem -Path "." -Include "node_modules" -Recurse -File:$false | Remove-Item -Recurse -Force
8181
Remove-Quiet -Force "package-lock.json"

tools/bootstrap/node

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ NodeVersion="$NODE_VERSION_PRECISE"
2222
NodeFullVersion="node-v$NodeVersion-win-x64"
2323
NodeDir="$Cache/$NodeFullVersion"
2424
NodeExe="$NodeDir/node.exe"
25-
Log="$Cache/last-command.log"
25+
is_vendored="1"
2626

2727
# If a bootstrapped Node is not present, search on $PATH.
2828
if [ "$(uname)" = "Linux" ] || [ ! -f "$NodeExe" ]; then
@@ -39,6 +39,7 @@ if [ "$(uname)" = "Linux" ] || [ ! -f "$NodeExe" ]; then
3939
fi
4040
elif command -v node >/dev/null 2>&1; then
4141
NodeExe="node"
42+
is_vendored="0"
4243
else
4344
echo
4445
if command -v apt-get >/dev/null 2>&1; then
@@ -62,23 +63,11 @@ if [ "$(uname)" = "Linux" ] || [ ! -f "$NodeExe" ]; then
6263
fi
6364
fi
6465

65-
# Cheap shell function if tee.exe is not available
66-
if ! command -v tee >/dev/null 2>&1; then
67-
tee() {
68-
# Fudge: assume $1 is always "-a"
69-
while read -r line; do
70-
echo "$line" >> "$2"
71-
echo "$line"
72-
done
73-
}
74-
fi
75-
7666
# Invoke Node with all command-line arguments
77-
mkdir -p "$Cache"
78-
printf '%s\n' "$NodeExe" "$@" > "$Log"
79-
printf -- '---\n' >> "$Log"
80-
exec 4>&1
81-
PATH="$(readlink -f "$NodeDir"):$PATH" # Set PATH so that recursive calls find it
82-
exitstatus=$({ { set +e; "$NodeExe" "$@" 2>&1 3>&-; printf %s $? >&3; } 4>&- | tee -a "$Log" 1>&4; } 3>&1)
83-
exec 4>&-
84-
exit "$exitstatus"
67+
if [ "$is_vendored" = "1" ]; then
68+
PATH="$(readlink -f "$NodeDir"):$PATH"
69+
echo "Using vendored Node $("$NodeExe" --version)"
70+
else
71+
echo "Using system-wide Node $("$NodeExe" --version)"
72+
fi
73+
exec "$NodeExe" "$@"

tools/build/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ This build script is the recommended way to compile the game, including not only
1313

1414
The script will skip build steps whose inputs have not changed since the last run.
1515

16+
## Getting list of available targets
17+
18+
You can get a list of all targets that you can build by running the following command:
19+
20+
```
21+
tools/build/build --help
22+
```
23+
1624
## Dependencies
1725

1826
- On Windows, `BUILD.bat` will automatically install a private (vendored) copy of Node.

0 commit comments

Comments
 (0)