Skip to content

Commit 9c108c2

Browse files
committed
Fix pipeline
1 parent da34245 commit 9c108c2

File tree

1 file changed

+55
-7
lines changed

1 file changed

+55
-7
lines changed

.github/workflows/l10n-validate.yml

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,66 @@ on:
44
pull_request:
55
paths:
66
- 'resources/translations/**/*.xlf'
7+
- 'composer.lock'
8+
- 'composer.json'
79

810
jobs:
911
validate-xliff:
1012
runs-on: ubuntu-22.04
13+
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
php: ['8.1']
18+
1119
steps:
12-
- uses: actions/checkout@v4
13-
- uses: php-actions/composer@v6
14-
- name: Validate XLIFF XML
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Setup PHP
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: ${{ matrix.php }}
27+
extensions: imap, zip
28+
tools: composer:v2
29+
coverage: none
30+
31+
- name: Cache Composer packages
32+
uses: actions/cache@v4
33+
with:
34+
path: |
35+
~/.composer/cache/files
36+
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
37+
restore-keys: |
38+
${{ runner.os }}-composer-${{ matrix.php }}-
39+
40+
- name: Install dependencies (no dev autoloader scripts)
1541
run: |
16-
sudo apt-get update && sudo apt-get install -y libxml2-utils
17-
find translations -name '*.xlf' -print0 | xargs -0 -n1 xmllint --noout
42+
set -euo pipefail
43+
composer install --no-interaction --no-progress --prefer-dist
44+
45+
- name: Lint XLIFF with Symfony
46+
run: |
47+
set -euo pipefail
48+
# Adjust the directory to match your repo layout
49+
php bin/console lint:xliff resources/translations
50+
51+
- name: Validate XLIFF XML with xmllint
52+
run: |
53+
set -euo pipefail
54+
sudo apt-get update
55+
sudo apt-get install -y --no-install-recommends libxml2-utils
56+
# Adjust root dir; prune vendor; accept spaces/newlines safely
57+
find resources/translations -type f -name '*.xlf' -not -path '*/vendor/*' -print0 \
58+
| xargs -0 -n1 xmllint --noout
59+
1860
- name: Symfony translation sanity (extract dry-run)
1961
run: |
20-
composer install --no-interaction --no-progress
21-
php bin/console translation:extract en --format=xlf --domain=messages --no-interaction
62+
set -euo pipefail
63+
# Show what would be created/updated without writing files
64+
php bin/console translation:extract en \
65+
--format=xlf \
66+
--domain=messages \
67+
--dump-messages \
68+
--no-interaction
69+
# Note: omit --force to keep this a dry-run

0 commit comments

Comments
 (0)