CI: Check/build the docs

Still no publish or further steps
This commit is contained in:
Henrik Tjäder 2023-01-28 14:12:32 +01:00
parent 6021aa2df8
commit 48ac310036

View file

@ -522,96 +522,100 @@ jobs:
working-directory: ./rtic-time working-directory: ./rtic-time
run: cargo test --test tests run: cargo test --test tests
# # Build documentation, check links # Build documentation, check links
# docs: docs:
# name: docs name: docs
# runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
# steps: steps:
# - name: Checkout - name: Checkout
# uses: actions/checkout@v3 uses: actions/checkout@v3
#
# - name: Cache pip installed linkchecker - name: Cache pip installed linkchecker
# uses: actions/cache@v3 uses: actions/cache@v3
# with: with:
# path: ~/.cache/pip path: ~/.cache/pip
# key: ${{ runner.os }}-pip key: ${{ runner.os }}-pip
# restore-keys: | restore-keys: |
# ${{ runner.os }}-pip- ${{ runner.os }}-pip-
#
# - name: Set up Python 3.x - name: Set up Python 3.x
# uses: actions/setup-python@v4 uses: actions/setup-python@v4
# with: with:
# # Semantic version range syntax or exact version of a Python version # Semantic version range syntax or exact version of a Python version
# python-version: '3.x' python-version: '3.x'
#
# # You can test your matrix by printing the current Python version # You can test your matrix by printing the current Python version
# - name: Display Python version - name: Display Python version
# run: python -c "import sys; print(sys.version)" run: python -c "import sys; print(sys.version)"
#
# - name: Install dependencies - name: Install dependencies
# run: pip install git+https://github.com/linkchecker/linkchecker.git run: pip install git+https://github.com/linkchecker/linkchecker.git
#
# - name: Remove cargo-config - name: Remove cargo-config
# run: rm -f .cargo/config working-directory: ./rtic
# run: rm -f .cargo/config
# - name: Fail on warnings
# run: sed -i 's,//deny_warnings_placeholder_for_ci,#![deny(warnings)],' src/lib.rs macros/src/lib.rs - name: Fail on warnings
# working-directory: ./rtic
# - name: Build docs run: sed -i 's,//deny_warnings_placeholder_for_ci,#![deny(warnings)],' src/lib.rs macros/src/lib.rs
# run: cargo doc
# - name: Build docs
# - name: Check links working-directory: ./rtic
# run: | run: cargo doc
# td=$(mktemp -d)
# cp -r target/doc $td/api - name: Check links
# linkchecker $td/api/rtic/ working-directory: ./rtic
# linkchecker $td/api/cortex_m_rtic_macros/ run: |
# td=$(mktemp -d)
# # Build the books cp -r target/doc $td/api
# mdbook: linkchecker $td/api/rtic/
# name: mdbook linkchecker $td/api/rtic_macros/
# runs-on: ubuntu-22.04
# steps: # Build the books
# - name: Checkout mdbook:
# uses: actions/checkout@v3 name: mdbook
# - name: Set up Python 3.x runs-on: ubuntu-22.04
# uses: actions/setup-python@v4 steps:
# with: - name: Checkout
# # Semantic version range syntax or exact version of a Python version uses: actions/checkout@v3
# python-version: '3.x' - name: Set up Python 3.x
# uses: actions/setup-python@v4
# # You can test your matrix by printing the current Python version with:
# - name: Display Python version # Semantic version range syntax or exact version of a Python version
# run: python -c "import sys; print(sys.version)" python-version: '3.x'
#
# - name: Install dependencies # You can test your matrix by printing the current Python version
# run: pip install git+https://github.com/linkchecker/linkchecker.git - name: Display Python version
# run: python -c "import sys; print(sys.version)"
# - name: mdBook Action
# uses: peaceiris/actions-mdbook@v1 - name: Install dependencies
# with: run: pip install git+https://github.com/linkchecker/linkchecker.git
# mdbook-version: 'latest'
# - name: mdBook Action
# - name: Build book in English uses: peaceiris/actions-mdbook@v1
# shell: 'script --return --quiet --command "bash {0}"' with:
# run: cd book/en && if mdbook build |& tee /dev/tty | grep "\[ERROR\]"; then exit 1; else exit 0; fi mdbook-version: 'latest'
#
# - name: Build book in Russian - name: Build book in English
# shell: 'script --return --quiet --command "bash {0}"' shell: 'script --return --quiet --command "bash {0}"'
# run: cd book/ru && if mdbook build |& tee /dev/tty | grep "\[ERROR\]"; then echo "Russian book needs updating!"; else exit 0; fi run: cd book/en && if mdbook build |& tee /dev/tty | grep "\[ERROR\]"; then exit 1; else exit 0; fi
#
# - name: Check links - name: Build book in Russian
# run: | shell: 'script --return --quiet --command "bash {0}"'
# td=$(mktemp -d) run: cd book/ru && if mdbook build |& tee /dev/tty | grep "\[ERROR\]"; then echo "Russian book needs updating!"; else exit 0; fi
# mkdir $td/book
# cp -r book/en/book $td/book/en - name: Check links
# cp -r book/ru/book $td/book/ru run: |
# cp LICENSE-* $td/book/en td=$(mktemp -d)
# cp LICENSE-* $td/book/ru mkdir $td/book
# cp -r book/en/book $td/book/en
# linkchecker $td/book/en/ cp -r book/ru/book $td/book/ru
# linkchecker $td/book/ru/ cp LICENSE-* $td/book/en
# cp LICENSE-* $td/book/ru
linkchecker $td/book/en/
linkchecker $td/book/ru/
# # Update stable branch # # Update stable branch
# # # #
# # This needs to run before book is built # # This needs to run before book is built