diff options
author | Robert Adam <dev@robert-adam.de> | 2020-05-10 13:39:56 +0300 |
---|---|---|
committer | CI <ci@mumble.info> | 2020-05-10 14:01:57 +0300 |
commit | 5e347c6efb8b8687d39ae0683ef607bdc1a330c4 (patch) | |
tree | 27af946265e8ac1d08def2bb661d64d435f370ca /scripts | |
parent | 54eb261ca37de0acb75a001e9fb7dbefb6123926 (diff) |
CI: Added check for unprocessed translations
As it happens rather frequently for someone (e.g. me) to forget to
update the translations after having messed with translated strings,
this commit introduces a check to the CI that verifies that the
translations are always up-to-date.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/azure-pipelines/assertNoTranslationChanges.sh | 35 | ||||
-rwxr-xr-x | scripts/azure-pipelines/install-environment_linux_translations.bash | 13 |
2 files changed, 48 insertions, 0 deletions
diff --git a/scripts/azure-pipelines/assertNoTranslationChanges.sh b/scripts/azure-pipelines/assertNoTranslationChanges.sh new file mode 100755 index 000000000..34ec2b3d9 --- /dev/null +++ b/scripts/azure-pipelines/assertNoTranslationChanges.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +# +# Copyright 2020 The Mumble Developers. All rights reserved. +# Use of this source code is governed by a BSD-style license +# that can be found in the LICENSE file at the root of the +# Mumble source tree or at <https://www.mumble.info/LICENSE>. + +set -e + +# Get path to the updatetranslations script +updateScript="`dirname $0`/../updatetranslations.sh" + +# Get current commit hash +oldHash=`git rev-parse HEAD` + +# In order for any commits to be possible, we'll have to set up a dummy user +git config user.name "CI" +git config user.email "ci@mumble.info" + +# Execute updatetranslations that'll commit any translation changes +"./$updateScript" > /dev/null +echo + +# Ger new commit hash +newHash=`git rev-parse HEAD` + +# Check if the commit hash has changed (aka whether a commit has been made). +# If so that means that there are unprocessed translation changes. +if [[ "$oldHash" = "$newHash" ]]; then + echo "No translations have changed" + exit 0 +else + echo "[ERROR]: There are unprocessed translation changes!" + exit 1 +fi diff --git a/scripts/azure-pipelines/install-environment_linux_translations.bash b/scripts/azure-pipelines/install-environment_linux_translations.bash new file mode 100755 index 000000000..bcd162cb5 --- /dev/null +++ b/scripts/azure-pipelines/install-environment_linux_translations.bash @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +# +# Copyright 2020 The Mumble Developers. All rights reserved. +# Use of this source code is governed by a BSD-style license +# that can be found in the LICENSE file at the root of the +# Mumble source tree or at <https://www.mumble.info/LICENSE>. + +set -e +set -x + +sudo apt-get update + +sudo apt-get -y install qttools5-dev-tools qt5-qmake |