Skip to content

Commit

Permalink
tgui autobuild is now build validation. adds initial gitlab ci support (
Browse files Browse the repository at this point in the history
tgstation#50547)

* tgui autobuild is now build validation. adds initial gitlab ci support

* Remove autobuild github action

Co-authored-by: Aleksej Komarov <[email protected]>
  • Loading branch information
jdawg1290 and stylemistake authored Apr 20, 2020
1 parent 5f403bb commit 1f4b2c9
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 38 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/autobuild_tgui.yml

This file was deleted.

11 changes: 11 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
build:
stage: build
rules:
- if: $CI_MERGE_REQUEST_IID || $CI_COMMIT_REF_NAME == "master"
changes:
- tgui/**/*.js
- tgui/**/*.scss
when: always
image: node:lts
script:
- tgui/bin/tgui --ci
14 changes: 14 additions & 0 deletions tgui/bin/tgui
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,19 @@ task-clean() {
rm -f **/package-lock.json
}

## Validates current build against the build stored in git
task-validate-build() {
cd "${base_dir}"
local diff
diff="$(git diff packages/tgui/public/tgui.bundle.*)"
if [[ -n ${diff} ]]; then
echo "Error: our build differs from the build committed into git."
echo "Please rebuild tgui."
exit 1
fi
echo "tgui: build is ok"
}

## Installs merge drivers and git hooks
task-install-git-hooks() {
cd "${base_dir}"
Expand Down Expand Up @@ -110,6 +123,7 @@ if [[ ${1} == "--ci" ]]; then
task-install
task-eslint
task-webpack --mode=production
task-validate-build
exit 0
fi

Expand Down

0 comments on commit 1f4b2c9

Please sign in to comment.