From 51adaf25ffaddd681867901c3496d040f3a227d9 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Mon, 4 Mar 2024 13:01:28 +0100 Subject: [PATCH] ci: Verify the HTML documentation is up-to-date Using Fedora image as the ubuntu creates non-standard /usr/etc/... paths without more tweaking Fixes: #3056 --- .github/setup-fedora.sh | 2 +- .github/workflows/doc.yml | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/doc.yml diff --git a/.github/setup-fedora.sh b/.github/setup-fedora.sh index 5f280cea926..0bd1a16ad95 100755 --- a/.github/setup-fedora.sh +++ b/.github/setup-fedora.sh @@ -3,7 +3,7 @@ set -ex -o xtrace # Generic dependencies -DEPS="make /usr/bin/xsltproc docbook-style-xsl autoconf automake libtool bash-completion vim-common softhsm openssl diffutils" +DEPS="make /usr/bin/xsltproc docbook-style-xsl autoconf automake libtool bash-completion vim-common softhsm openssl diffutils git" if [ "$1" == "clang" ]; then DEPS="$DEPS clang" diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml new file mode 100644 index 00000000000..4be15e2998f --- /dev/null +++ b/.github/workflows/doc.yml @@ -0,0 +1,37 @@ +--- +name: Make sure HTML files are updated + +on: + pull_request: + paths: + - '**.xml' + - '**.xml.in' + - .github/workflows/doc.yml + +jobs: + build: + runs-on: ubuntu-latest + container: + image: fedora:latest + steps: + - run: dnf install -y git + - uses: actions/checkout@v3 + - run: .github/setup-fedora.sh + - run: | + git config --global --add safe.directory $GITHUB_WORKSPACE + ./bootstrap && + ./configure --prefix="/usr" --enable-doc && + cd doc/tools && + rm tools.html && + make tools.html && + cd ../files && + rm files.html && + make files.html && + cd ../../ && + git diff --exit-code --color || ( + echo "The documentation files were changed!" + echo -n "Regenerate the HTML files with " + echo -n "\`make tools.html\` in \`doc/tools\` and " + echo -n "\`make files.html\`in \`doc/files\` or apply the above patch" + exit 1 + )