Skip to content

Commit 7bee4b3

Browse files
added check for missing translations to gitlab build (#4172)
2 parents a2449e6 + c4d2520 commit 7bee4b3

3 files changed

Lines changed: 30 additions & 7 deletions

File tree

.gitlab-ci.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ test:storefront-standards-with-codegen-with-tests-with-licenses-check:
8888
- corepack enable
8989
- corepack prepare --activate pnpm@9.0.5
9090
- pnpm config set store-dir .pnpm-store
91-
- apk add --no-cache grep
91+
- apk add --no-cache grep git
9292
- cp ./app/schema.graphql ./storefront/schema.graphql
9393
- cd ./storefront
9494
script:
@@ -98,6 +98,15 @@ test:storefront-standards-with-codegen-with-tests-with-licenses-check:
9898
- pnpm run check
9999
- pnpm test--no-watch
100100
- sh scripts/check-licenses.sh
101+
- pnpm run translate
102+
- |
103+
if [ -n "$(git status --porcelain)" ]; then
104+
echo "Not all translations are dumped. Run 'pnpm run translate' and commit the changes."
105+
git status -s
106+
exit 1
107+
else
108+
echo "All translations are dumped"
109+
fi
101110
interruptible: true
102111

103112
tests:functional-and-acceptance-with-licenses-check:
@@ -106,11 +115,24 @@ tests:functional-and-acceptance-with-licenses-check:
106115
<<: *only-default
107116
tags:
108117
- tests
118+
needs:
119+
- build
120+
- build-storefront
109121
script:
110122
- cp -f ./gitlab/docker-compose-ci.yml ./docker-compose.yml
111123
- docker compose up -d
112124
- docker compose exec -T php-fpm /bin/bash -c "mv PRODUCTION DEVELOPMENT; php phing composer-dev npm-install-dependencies test-db-create frontend-api-generate-new-keys tests tests-acceptance-build tests-acceptance"
113125
- docker compose exec -T php-fpm bash -c "scripts/check-licenses.sh"
126+
- docker compose exec -T php-fpm /bin/bash -c "php phing translations-dump"
127+
- docker compose cp php-fpm:/var/www/html/translations ./app/
128+
- |
129+
if [ -n "$(git status --porcelain)" ]; then
130+
echo "Not all translations are dumped. Run 'php phing translations-dump' and commit the changes."
131+
git status -s
132+
exit 1
133+
else
134+
echo "All translations are dumped"
135+
fi
114136
after_script:
115137
- mkdir -p codeception/
116138
- docker cp shopsys-framework-php-fpm:/var/www/html/var/log/codeception/ ./

app/translations/tests.cs.po

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ msgstr ""
44
"Content-Transfer-Encoding: 8bit\n"
55
"Language: cs\n"
66

7-
msgid "book"
8-
msgstr "kniha"
7+
msgid "Test image"
8+
msgstr "Testovací obrázek"
99

1010
msgid "audio"
1111
msgstr "audio"
1212

13-
msgid "Test image"
14-
msgstr "Testovací obrázek"
13+
msgid "book"
14+
msgstr "kniha"
15+

app/translations/tests.en.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ msgstr ""
44
"Content-Transfer-Encoding: 8bit\n"
55
"Language: en\n"
66

7-
msgid "book"
7+
msgid "Test image"
88
msgstr ""
99

1010
msgid "audio"
1111
msgstr ""
1212

13-
msgid "Test image"
13+
msgid "book"
1414
msgstr ""

0 commit comments

Comments
 (0)