Skip to content

Commit 86d6134

Browse files
committed
ci(i18n): install dev/test gems and use bundler-cache; add bin/i18n helper and docs; run workflow via helper
1 parent 7cd9c12 commit 86d6134

File tree

3 files changed

+49
-14
lines changed

3 files changed

+49
-14
lines changed

.github/workflows/i18n-health.yml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ on:
1313
jobs:
1414
i18n-health:
1515
runs-on: ubuntu-latest
16+
env:
17+
# Ensure dev/test gems (incl. i18n-tasks) are installed
18+
BUNDLE_WITHOUT: ""
19+
BUNDLE_WITH: "development:test"
1620
if: github.event_name == 'push' || github.event_name == 'pull_request'
1721
steps:
1822
- name: Checkout code
@@ -21,23 +25,14 @@ jobs:
2125
uses: ruby/setup-ruby@v1
2226
with:
2327
ruby-version: '3.4.4'
24-
- name: Install dependencies
25-
run: |
26-
gem install bundler
27-
bundle install
28+
bundler-cache: true
2829
- name: Normalize locale files
29-
run: |
30-
bundle exec i18n-tasks normalize
31-
- name: Check missing translations
32-
run: |
33-
bundle exec i18n-tasks check-missing
34-
- name: Check consistent interpolations
35-
run: |
36-
bundle exec i18n-tasks check-consistent-interpolations
30+
run: bin/i18n normalize
31+
- name: Run i18n checks
32+
run: bin/i18n check
3733
- name: Upload i18n health report
3834
if: always()
39-
run: |
40-
bundle exec i18n-tasks health > i18n-health.txt
35+
run: bin/i18n health > i18n-health.txt
4136
continue-on-error: true
4237
- name: Archive i18n health report
4338
uses: actions/upload-artifact@v4

AGENTS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Instructions for GitHub Copilot and other automated contributors working in this
2323
- **Lint:** `bundle exec rubocop`
2424
- **Security:** `bundle exec brakeman --quiet --no-pager` and `bundle exec bundler-audit --update`
2525
- **Style:** `bin/codex_style_guard`
26+
- **I18n:** `bin/i18n [normalize|check|health|all]` (runs normalize + missing + interpolation checks by default)
2627

2728
## Security Requirements
2829
## Security Requirements
@@ -105,6 +106,9 @@ i18n-tasks add-missing
105106
i18n-tasks health
106107
```
107108

109+
## CI Note
110+
- The i18n GitHub Action installs dev/test gem groups to make `i18n-tasks` available. Locally, you can mirror CI with `bin/i18n`, which sets `BUNDLE_WITH=development:test` automatically.
111+
108112
See `.github/instructions/i18n-mobility.instructions.md` for additional translation rules.
109113

110114
# Testing Requirements

bin/i18n

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# Ensure i18n-tasks (in development/test groups) is available
5+
export DISABLE_SPRING=1
6+
export BUNDLE_WITH="${BUNDLE_WITH:-development:test}"
7+
export BUNDLE_WITHOUT="${BUNDLE_WITHOUT:-}"
8+
9+
usage() {
10+
echo "Usage: bin/i18n [normalize|check|health|all]" >&2
11+
}
12+
13+
cmd="${1:-all}"
14+
15+
case "$cmd" in
16+
normalize)
17+
bundle exec i18n-tasks normalize
18+
;;
19+
check)
20+
bundle exec i18n-tasks check-missing
21+
bundle exec i18n-tasks check-consistent-interpolations
22+
;;
23+
health)
24+
bundle exec i18n-tasks health
25+
;;
26+
all)
27+
bundle exec i18n-tasks normalize
28+
bundle exec i18n-tasks check-missing
29+
bundle exec i18n-tasks check-consistent-interpolations
30+
;;
31+
*)
32+
usage
33+
exit 1
34+
;;
35+
esac
36+

0 commit comments

Comments
 (0)