Skip to content

Commit 8121dd8

Browse files
authored
add GitHub Actions workflow to build Antora documentation. (#325)
* add GitHub Actions workflow to build Antora documentation. * update GitHub Actions workflow to use v4 of upload-artifact action. * enhance Antora build workflow: add debug output, ensure directories exist, and copy files directly. * simplify Antora setup in GitHub Actions workflow by leveraging Makefile. * improve Antora build workflow: fail on warnings or errors and ensure issues are logged properly. * refine Antora build workflow: improve error detection by matching additional error patterns. * refine Antora build workflow: use `-q` flag with grep for cleaner error detection. * simplify Antora build workflow: streamline error detection logic for warnings and errors. * enhance Antora build workflow: add support for copying SVG files to the images directory. * fix typo in shader language comparison table formatting
1 parent 6a50369 commit 8121dd8

File tree

3 files changed

+90
-1
lines changed

3 files changed

+90
-1
lines changed

.github/workflows/antora-build.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Copyright 2021 The Khronos Group, Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# Github workflow file for Antora documentation build
5+
6+
name: Antora Build
7+
8+
# Controls when the action will run.
9+
on:
10+
pull_request:
11+
types: [ opened, synchronize, reopened ]
12+
# Triggers the workflow on push or manual dispatch
13+
push:
14+
workflow_dispatch:
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
antora-build:
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can
25+
# access it
26+
- uses: actions/checkout@v3
27+
28+
# Set up Node.js environment
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v3
31+
with:
32+
node-version: '16'
33+
34+
# Install Antora CLI and site generator
35+
- name: Install Antora
36+
run: npm i -g @antora/[email protected] @antora/[email protected]
37+
38+
# Setup Antora directory structure
39+
- name: Setup Antora directory structure
40+
run: |
41+
make -f antora/Makefile setup
42+
43+
# Create a simple Antora playbook
44+
- name: Create Antora playbook
45+
run: |
46+
echo "site:
47+
title: Vulkan Guide
48+
url: https://github.com/KhronosGroup/Vulkan-Guide
49+
start_page: guide::index.adoc
50+
content:
51+
sources:
52+
- url: .
53+
start_path: antora
54+
ui:
55+
bundle:
56+
url: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/HEAD/raw/build/ui-bundle.zip?job=bundle-stable
57+
snapshot: true" > antora-playbook.yml
58+
59+
# Run Antora build
60+
- name: Build Antora site
61+
run: |
62+
# Run Antora and capture output and exit code
63+
OUTPUT=$(antora --stacktrace antora-playbook.yml 2>&1)
64+
EXIT_CODE=$?
65+
66+
# Print the output
67+
echo "$OUTPUT"
68+
69+
# Check for errors or warnings in the output
70+
# Look for patterns that indicate warnings or errors in Antora output
71+
# Using a simpler approach to check for ERROR or WARN in the output
72+
if [[ "$OUTPUT" == *"ERROR"* || "$OUTPUT" == *"WARN"* || "$OUTPUT" == *"WARNING"* ]]; then
73+
echo "::error::Antora build produced errors or warnings. Failing the build."
74+
exit 1
75+
fi
76+
77+
# Also fail if the Antora command itself failed
78+
if [ $EXIT_CODE -ne 0 ]; then
79+
echo "::error::Antora build failed with exit code $EXIT_CODE"
80+
exit $EXIT_CODE
81+
fi
82+
83+
# Archive the build artifacts
84+
- name: Archive Antora build
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: antora-site
88+
path: build/site

antora/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ setup_spec:
2323
$(CP) $(wildcard chapters/extensions/[A-Za-z]*.adoc) $(ROOT)/pages/extensions/
2424
mkdir -p $(ROOT)/images
2525
$(CP) $(wildcard chapters/images/[A-Za-z]*.png) $(ROOT)/images/
26+
$(CP) $(wildcard chapters/images/[A-Za-z]*.svg) $(ROOT)/images/
2627
$(CP) $(wildcard images/[A-Za-z]*.png) $(ROOT)/images/
2728
mkdir -p $(ROOT)/images/extensions
2829
$(CP) $(wildcard chapters/images/extensions/[A-Za-z]*.png) $(ROOT)/images/extensions

chapters/high_level_shader_language_comparison.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ ConstantBuffer<SBT> sbt;
776776
[[vk::ext_builtin_input(HitTriangleVertexPositionsKHR)]]
777777
----
778778
| Requires `GL_EXT_ray_tracing_position_fetch`
779-
| shadercallcoherent | n.a.
779+
| shadercallcoherent | n.a. |
780780
|====
781781

782782
=== Compute

0 commit comments

Comments
 (0)