feat: ci/cd - validate translations (#109)
continuous-integration/drone/push Build is passing Details

Reviewed-on: #109
This commit is contained in:
Dawid Wysokiński 2023-06-25 07:17:37 +00:00
parent 09ffc7644a
commit 0cc1f1637a
3 changed files with 45 additions and 1 deletions

View File

@ -67,6 +67,26 @@ trigger:
branch:
- master
---
kind: pipeline
type: docker
name: translations
steps:
- name: validate
image: golang:1.20
pull: always
commands:
- apt update && apt -y install jq
- make validate-translations
trigger:
event:
- push
- pull_request
branch:
- master
---
kind: pipeline
type: docker
@ -372,6 +392,6 @@ depends_on:
- migrations-manifest
---
kind: signature
hmac: adb6f2a2d07f26eb833ea4cac0f54bb6aea7bc53a38d423afe7408701b270ac2
hmac: 4fa2583c281aacc0e4d0dc87296a2ce6ff7facf71d1ce2e9f5d4157b35635d4f
...

View File

@ -47,3 +47,7 @@ create-sql-migration: install-goose
.PHONY: validate-migrations
validate-migrations: install-goose
@goose -dir migrations -v validate
.PHONY: validate-translations
validate-translations:
@./validate_translations.sh

20
validate_translations.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
LOCALE_EN_PATH="./internal/discord/internal/discordi18n/locale.en.json"
status=0
for path in ./internal/discord/internal/discordi18n/locale.*.json; do
if [ "$path" = $LOCALE_EN_PATH ]; then
continue
fi
echo "----- ${path}"
if diff <(jq 'keys' $LOCALE_EN_PATH) <(jq 'keys' "$path"); then
echo "----- Success"
else
status=1
echo "----- Failed"
fi
done
exit "$status"