Skip to content

Commit

Permalink
[docs] plantuml integration. Add first draft of new gitHub workflow t…
Browse files Browse the repository at this point in the history
…o check consistency of diagrams' svg files with their associated PlantUML source files
  • Loading branch information
emschu committed Jul 30, 2021
1 parent e072320 commit 633bfa1
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/docs-plantuml-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Licensed to Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Apache Software Foundation (ASF) licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

name: PlantUML SVG Diagram Consistency

on:
pull_request:
paths:
- 'docs/*.plantuml'
- 'docs/*.svg'
push:
branches:
- main

jobs:
check-plantuml-svg-diagram-consistency:
name: Check Consistency of PlantUML files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'

- run: make verify-docs
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ bin/
assets/assets.gen.go
.DS_Store
coverage.txt
plantuml.jar
19 changes: 18 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ GO_TEST = $(GO) test
GO_LINT = $(GO_PATH)/bin/golangci-lint
GO_BUILD_LDFLAGS = -X github.com/apache/skywalking-eyes/$(PROJECT)/commands.version=$(VERSION)

PLANTUML_VERSION = 1.2021.9

PLATFORMS := windows linux darwin
os = $(word 1, $@)
ARCH = amd64
Expand Down Expand Up @@ -77,7 +79,7 @@ clean:
-rm -rf "$(RELEASE_SRC)"*

.PHONY: verify
verify: clean license lint test
verify: clean license lint test verify-docs

release-src: clean
-tar -zcvf $(RELEASE_SRC).tgz \
Expand Down Expand Up @@ -105,3 +107,18 @@ release: verify release-src release-bin
shasum -a 512 $(RELEASE_SRC).tgz > $(RELEASE_SRC).tgz.sha512
gpg --batch --yes --armor --detach-sig $(RELEASE_BIN).tgz
shasum -a 512 $(RELEASE_BIN).tgz > $(RELEASE_BIN).tgz.sha512

.PHONY: docs-gen
docs-gen:
-if [ ! -f "plantuml.jar" ]; then curl -sL -o plantuml.jar https://repo1.maven.org/maven2/net/sourceforge/plantuml/plantuml/$(PLANTUML_VERSION)/plantuml-$(PLANTUML_VERSION).jar; fi;
-java -jar plantuml.jar -version
-java -jar plantuml.jar -tsvg -nometadata docs/*.plantuml

.PHONY: verify-docs
verify-docs: docs-gen
-if [ ! -z "`git status -s docs`" ]; then \
echo "Following files are not consistent with CI:"; \
git status -s docs; \
git diff --color --exit-code docs; \
exit 1; \
fi

0 comments on commit 633bfa1

Please sign in to comment.