Skip to content

Commit 9ad25f4

Browse files
committed
Test extracting messages from the Rust Book
This did not work before because we produced many duplicate `""` messages.
1 parent fa13551 commit 9ad25f4

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/test.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,39 @@ jobs:
2525
- name: Test
2626
run: cargo test
2727

28+
rust-book:
29+
name: Test with Rust Book
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/checkout@v3
34+
35+
- uses: Swatinem/rust-cache@v2
36+
with:
37+
save-if: ${{ github.ref == 'refs/heads/main' }}
38+
39+
- name: Install tools
40+
run: |
41+
sudo apt install gettext
42+
# Debug builds are fine and slightly faster.
43+
cargo install --debug --path i18n-helpers
44+
cargo install --debug --locked --version 0.4.35 mdbook
45+
46+
- name: Checkout Rust Book
47+
uses: actions/checkout@v4
48+
with:
49+
repository: rust-lang/book
50+
# Update the commit hash once in a while to test newer
51+
# versions.
52+
ref: 5b6c1ceaa62ecbd6caef08df39b33b3938e99deb
53+
path: rust-book
54+
55+
- name: Test extracting text from Rust Book
56+
working-directory: rust-book
57+
run: |
58+
MDBOOK_OUTPUT='{"xgettext": {"pot-file": "messages.pot"}}' mdbook build -d po
59+
msgfmt -o /dev/null --statistics po/messages.pot
60+
2861
fuzz:
2962
name: Fuzz test
3063
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)