Skip to content

Commit

Permalink
feat: re-generate plantuml images in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
typeid committed Sep 4, 2023
1 parent aca59cf commit 72a80b2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .github/workflows/pr-plantuml-generate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
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
volumes:
- docs:/docs
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ YQ_BIN := yq
YQ := $(abspath $(TOOLS_BIN_DIR)/$(YQ_BIN)-$(YQ_VER))
YQ_PKG := github.com/mikefarah/yq/v4

PLANTUML_VER := 1.2023
PLANTUML_VER := 1.2023 # In case this gets bumped, also bump the version in .github/workflows/pr-plantuml-generate.yaml

GINKGO_BIN := ginkgo
GINGKO_VER := $(call get_go_version,github.com/onsi/ginkgo/v2)
Expand Down

0 comments on commit 72a80b2

Please sign in to comment.