From 0645d3ed85ea8794bb0af166db3ae202d0d9425b Mon Sep 17 00:00:00 2001 From: Claudio Busse Date: Mon, 4 Sep 2023 15:58:50 +0200 Subject: [PATCH] feat: re-generate plantuml images in CI --- .github/workflows/pr-plantuml-generate.yaml | 30 +++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/pr-plantuml-generate.yaml diff --git a/.github/workflows/pr-plantuml-generate.yaml b/.github/workflows/pr-plantuml-generate.yaml new file mode 100644 index 000000000000..339e8f3590d8 --- /dev/null +++ b/.github/workflows/pr-plantuml-generate.yaml @@ -0,0 +1,30 @@ +name: PR verify-plantuml + +on: + pull_request: + types: [opened, edited, synchronize, reopened] + +# Remove all permissions from GITHUB_TOKEN except metadata. +permissions: {} + +jobs: + plantuml-generate-check: + name: Image generation reproducible test + runs-on: ubuntu-latest + container: + image: plantuml/plantuml:1.2023 + steps: + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # tag=v3.6.0 + - name: "Prerequisite: install git" + run: apt-get -qq update && apt-get install -qq git # git is required for the diff, it isn't contained in the plantuml image + - name: Generate Plantuml Images + run: java -jar /opt/plantuml.jar ./docs/book/**/*.plantuml && java -jar /opt/plantuml.jar ./docs/proposals/**/*.plantuml + - name: Check if anything changed + run: | + if git diff --quiet ./docs/; then + echo "No changes from image re-generation." + else + echo "Re-generating images resulted in changes:" + git status --porcelain + exit 1 + fi \ No newline at end of file