1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-03-05 16:36:19 +02:00
Martin Geisler c45bb19528 Test i18n-helpers on pull requests
This ensures that our i18n helpers stay working.
2023-01-18 16:12:53 +01:00

83 lines
1.8 KiB
YAML

name: Test
on:
pull_request:
push:
branches:
- main
env:
CARGO_TERM_COLOR: always
jobs:
mdbook:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Install mdbook
run: cargo install mdbook --version 0.4.25
- name: Install mdbook-svgbob
run: cargo install mdbook-svgbob --version 0.2.1
- name: Test code snippets
run: mdbook test
cargo:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Test Rust code
run: cargo test
- name: Test i18n-helpers
run: cargo test
working-directory: i18n-helpers
translations:
runs-on: ubuntu-latest
strategy:
matrix:
language:
- da
env:
MDBOOK_BOOK__LANGUAGE: ${{ matrix.language }}
MDBOOK_PREPROCESSOR__GETTEXT__PO_FILE: po/${{ matrix.language }}.po
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Install Gettext
run: sudo apt install gettext
- name: Install mdbook
run: cargo install mdbook --version 0.4.25
- name: Install mdbook-svgbob
run: cargo install mdbook-svgbob --version 0.2.1
- name: Install i18n-helpers
run: cargo install --path i18n-helpers --locked
- name: Test ${{ matrix.language }} translation
run: msgfmt --statistics -o /dev/null po/${{ matrix.language }}.po
- name: Build course with ${{ matrix.language }} translation
run: mdbook build
- name: Test code snippets with ${{ matrix.language }} translation
run: mdbook test