-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (42 loc) · 1.5 KB
/
test-docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Test documentation compilation
on:
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: pages
fetch-depth: 0
- uses: actions/checkout@v4
with:
repository: Jelly-RDF/jelly-protobuf
path: proto
- name: Generate Protobuf reference
run: |
mkdir -p pages/docs/specification/proto
cp proto/*.proto pages/docs/specification/proto
# Remove double newlines in comments to avoid breaking markdown tables
# See: https://github.com/pseudomuto/protoc-gen-doc/issues/274
find proto/*.proto -type f -exec perl -0777 -i -pe "s|\n[ \t]+//[ \t]*\n|\n|igs" {} \;
find proto/*.proto -type f -exec perl -0777 -i -pe "s|(https?[^\s]+)|[\1](\1)|igs" {} \;
docker run --rm -v $(pwd)/proto:/protos -v $(pwd)/pages/docs/specification:/out pseudomuto/protoc-gen-doc --doc_opt=markdown,reference.md
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip
cache-dependency-path: 'pages/requirements.txt'
- name: Install dependencies
working-directory: ./pages
run: pip install -r requirements.txt
- name: Build documentation
working-directory: ./pages
run: |
export TAG='main'
export JVM_TAG='main'
export PROTO_PATH='../proto'
mkdocs build -s