From 532765719fa935c8b7032ebe8b461598c9a15e8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Wed, 9 Feb 2022 17:01:01 +0100 Subject: [PATCH 1/2] docs: make mdBook emit error codes --- .github/workflows/build.yml | 15 +++++++++++---- CHANGELOG.md | 1 + 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d2b45c420f..31eaa9fa5e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -458,10 +458,12 @@ jobs: mdbook-version: 'latest' - name: Build book in English - run: cd book/en && mdbook build + shell: 'script --return --quiet --command "bash {0}"' + run: cd book/en && if mdbook build |& tee /dev/tty | grep "\[ERROR\]"; then exit 1; else exit 0; fi - name: Build book in Russian - run: cd book/ru && mdbook build + shell: 'script --return --quiet --command "bash {0}"' + run: cd book/ru && if mdbook build |& tee /dev/tty | grep "\[ERROR\]"; then exit 1; else exit 0; fi - name: Check links run: | @@ -518,6 +520,7 @@ jobs: run: cargo doc - name: Build books + shell: 'script --return --quiet --command "bash {0}"' run: | langs=( en ru ) devver=( dev ) @@ -549,7 +552,9 @@ jobs: # Build books for lang in ${langs[@]}; do - ( cd book/$lang && mdbook build ) + ( cd book/$lang && + if mdbook build |& tee /dev/tty | grep "\[ERROR\]"; then exit 1; else exit 0; fi + ) cp -r book/$lang/book $td/$devver/book/$lang cp LICENSE-* $td/$devver/book/$lang/ done @@ -569,7 +574,9 @@ jobs: cp -r target/doc $td/$prefix/api sed 's|URL|rtic/index.html|g' $root/redirect.html > $td/$prefix/api/index.html for lang in ${langs[@]}; do - ( cd book/$lang && mdbook build ) + ( cd book/$lang && + if mdbook build |& tee /dev/tty | grep "\[ERROR\]"; then exit 1; else exit 0; fi + ) cp -r book/$lang/book $td/$prefix/book/$lang cp LICENSE-* $td/$prefix/book/$lang/ done diff --git a/CHANGELOG.md b/CHANGELOG.md index 112491dd13..84b42f2257 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Fixed +- Force mdBook to return error codes - Readded missing ramfunc output to book ## [v1.0.0] - 2021-12-25 From 120d3109342ec34aed473d36e1d81b0039ce5ba4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Wed, 9 Feb 2022 17:59:00 +0100 Subject: [PATCH 2/2] Demote Russian translation to WIP --- .github/workflows/build.yml | 2 +- book/ru/src/by-example/tips.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 31eaa9fa5e..fc07519fde 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -463,7 +463,7 @@ jobs: - name: Build book in Russian shell: 'script --return --quiet --command "bash {0}"' - run: cd book/ru && if mdbook build |& tee /dev/tty | grep "\[ERROR\]"; then exit 1; else exit 0; fi + run: cd book/ru && if mdbook build |& tee /dev/tty | grep "\[ERROR\]"; then echo "Russian book needs updating!"; else exit 0; fi - name: Check links run: | diff --git a/book/ru/src/by-example/tips.md b/book/ru/src/by-example/tips.md index f19cfee9d8..7d4fc2f47b 100644 --- a/book/ru/src/by-example/tips.md +++ b/book/ru/src/by-example/tips.md @@ -83,12 +83,12 @@ $ cargo run --example ramfunc ``` console $ cargo nm --example ramfunc --release | grep ' foo::' -{{#include ../../../../ci/expected/ramfunc.grep.foo}} +{{#include ../../../../ci/expected/ramfunc.run.grep.foo}} ``` ``` console $ cargo nm --example ramfunc --release | grep ' bar::' -{{#include ../../../../ci/expected/ramfunc.grep.bar}} +{{#include ../../../../ci/expected/ramfunc.run.grep.bar}} ``` ## Обходной путь для быстрой передачи сообщений