mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-21 22:52:19 +03:00
fix(ci): fix jq command with -R raw input flag
- Also fix quick_check to only fail on missing keys (not untranslated) - Use compact JSON for GITHUB_OUTPUT
This commit is contained in:
41
.github/workflows/ci.yml
vendored
41
.github/workflows/ci.yml
vendored
@@ -32,6 +32,47 @@ jobs:
|
||||
- run: npm run typecheck:core
|
||||
- run: npm run typecheck:noimplicit:core
|
||||
|
||||
i18n:
|
||||
name: i18n Validation
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
lang: ${{ fromJson(needs.i18n-matrix.outputs.langs) }}
|
||||
needs: i18n-matrix
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.12'
|
||||
- name: Validate ${{ matrix.lang }}
|
||||
run: |
|
||||
echo "Validating language: ${{ matrix.lang }}"
|
||||
python3 scripts/validate_translation.py quick -l '${{ matrix.lang }}'
|
||||
- name: Report to summary
|
||||
if: always()
|
||||
run: |
|
||||
echo "### ${{ matrix.lang }} Translation Report" >> $GITHUB_STEP_SUMMARY
|
||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
||||
python3 scripts/validate_translation.py quick -l '${{ matrix.lang }}' >> $GITHUB_STEP_SUMMARY 2>&1
|
||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
i18n-matrix:
|
||||
name: Build language matrix
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
langs: ${{ steps.langs.outputs.langs }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Generate language list
|
||||
id: langs
|
||||
run: |
|
||||
LANG_DIR="src/i18n/messages"
|
||||
LANGS=$(ls "$LANG_DIR"/*.json | xargs -n1 basename | sed 's/.json$//' | grep -v '^en$' | jq -R . | jq -s .)
|
||||
echo "langs=${LANGS}" >> $GITHUB_OUTPUT
|
||||
echo "Found languages:"
|
||||
echo "$LANGS"
|
||||
|
||||
security:
|
||||
name: Security Audit
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -396,7 +396,8 @@ def quick_check() -> int:
|
||||
print(f"Missing: {len(missing)}")
|
||||
print(f"Untranslated: {len(untranslated)}")
|
||||
|
||||
return 0 if not missing and not untranslated else 1
|
||||
# Only fail on missing keys, untranslated is acceptable
|
||||
return 0 if not missing else 1
|
||||
|
||||
|
||||
def show_diff(category: str) -> int:
|
||||
|
||||
Reference in New Issue
Block a user