Skip to content

Commit 14114dc

Browse files
committed
update doc scripts
1 parent b4db8fa commit 14114dc

File tree

13 files changed

+912
-70797
lines changed

13 files changed

+912
-70797
lines changed

.github/workflows/ci.yml

Lines changed: 91 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,32 +1113,110 @@ jobs:
11131113
tag-pattern: 'boost-.*\..*\..*'
11141114

11151115
antora:
1116-
name: Antora Docs
1117-
runs-on: ubuntu-latest
1116+
needs: [ runner-selection ]
1117+
strategy:
1118+
matrix:
1119+
include:
1120+
# - { name: Windows, os: windows-latest }
1121+
- { name: Ubuntu, os: ubuntu-latest }
1122+
- { name: MacOS, os: macos-latest }
1123+
name: Antora Docs (${{ matrix.name }})
1124+
runs-on: ${{ fromJSON(needs.runner-selection.outputs.labelmatrix)[matrix.os] }}
1125+
defaults:
1126+
run:
1127+
shell: bash
11181128
steps:
1119-
- name: Clone Http.Proto
1129+
- name: Install packages
1130+
uses: alandefreitas/cpp-actions/package-install@v1.8.7
1131+
with:
1132+
apt-get: git cmake
1133+
1134+
- name: Clone Boost.Http.Proto
11201135
uses: actions/checkout@v3
1136+
with:
1137+
path: http-proto-root
11211138

1122-
- uses: actions/setup-node@v3
1139+
- name: Clone Boost.Buffers
1140+
uses: actions/checkout@v3
11231141
with:
1124-
node-version: 18
1142+
path: buffers-root
1143+
repository: cppalliance/buffers
1144+
ref: develop
11251145

1126-
- name: Setup C++
1127-
uses: alandefreitas/cpp-actions/setup-cpp@v1.8.7
1128-
id: setup-cpp
1146+
- name: Clone Boost
1147+
uses: alandefreitas/cpp-actions/boost-clone@v1.8.7
1148+
id: boost-clone
11291149
with:
1130-
compiler: clang
1131-
version: 18
1150+
branch: ${{ (github.ref_name == 'master' && github.ref_name) || 'develop' }}
1151+
boost-dir: boost-source
1152+
scan-modules-dir: http-proto-root
1153+
scan-modules-ignore: http_proto
11321154

1133-
- name: Build Antora Docs
1155+
- name: Patch Boost
1156+
id: patch
1157+
shell: bash
11341158
run: |
11351159
set -xe
1160+
pwd
1161+
ls
1162+
ls -lah boost-source
1163+
1164+
# Identify boost module being tested
1165+
module=${GITHUB_REPOSITORY#*/}
1166+
echo "module=$module" >> $GITHUB_OUTPUT
1167+
1168+
# Identify GitHub workspace root
1169+
workspace_root=$(echo "$GITHUB_WORKSPACE" | sed 's/\\/\//g')
1170+
echo -E "workspace_root=$workspace_root" >> $GITHUB_OUTPUT
11361171
1172+
# Remove module from boost-source
1173+
rm -r "boost-source/libs/$module" || true
1174+
1175+
# Copy cached boost-source to an isolated boost-root
1176+
cp -r boost-source boost-root
1177+
1178+
# Set boost-root output
1179+
cd boost-root
1180+
boost_root="$(pwd)"
1181+
boost_root=$(echo "$boost_root" | sed 's/\\/\//g')
1182+
echo -E "boost_root=$boost_root" >> $GITHUB_OUTPUT
1183+
1184+
# Patch boost-root with workspace module
1185+
cp -r "$workspace_root"/http-proto-root "libs/$module"
1186+
cp -r "$workspace_root"/buffers-root libs/buffers
1187+
1188+
python3 tools/boostdep/depinst/depinst.py buffers
1189+
python3 tools/boostdep/depinst/depinst.py http_proto
1190+
1191+
- uses: actions/setup-node@v4
1192+
with:
1193+
node-version: 18
1194+
1195+
- name: Setup Ninja
1196+
if: runner.os == 'Windows'
1197+
uses: seanmiddleditch/gha-setup-ninja@v5
1198+
1199+
- name: Build Antora Docs
1200+
env:
1201+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1202+
run: |
1203+
git config --global --add safe.directory "$(pwd)"
1204+
1205+
BOOST_SRC_DIR="$(pwd)/boost-root"
1206+
export BOOST_SRC_DIR
1207+
cd boost-root/libs/http_proto
1208+
11371209
cd doc
11381210
bash ./build_antora.sh
1211+
1212+
# Antora returns zero even if it fails, so we check if the site directory exists
1213+
if [ ! -d "build/site" ]; then
1214+
echo "Antora build failed"
1215+
exit 1
1216+
fi
11391217
11401218
- name: Create Antora Docs Artifact
1141-
uses: actions/upload-artifact@v3
1219+
uses: actions/upload-artifact@v4
11421220
with:
1143-
name: antora-docs
1221+
name: antora-docs-${{ matrix.name }}
11441222
path: doc/build/site

doc/antora.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,5 @@ asciidoc:
99
nav:
1010
- modules/ROOT/nav.adoc
1111
ext:
12-
collector:
13-
run:
14-
command: node doc/generate-files.mjs
15-
scan:
16-
dir: doc/build/generated-files
12+
cpp-reference:
13+
config: doc/mrdocs.yml

doc/build_antora.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ call "C:\Program Files\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build
1717
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
1818
set "PATH=%PATH%;C:\Program Files\7-Zip"
1919
set "PATH=%PATH%;%CD%\node_modules\.bin"
20-
call npx antora --clean --fetch "%PLAYBOOK%"
20+
call npx antora --clean --fetch "%PLAYBOOK%" --stacktrace --log-level all
2121
echo Done

doc/build_antora.sh

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,7 @@
77
# Official repository: https://github.com/boostorg/url
88
#
99

10-
set -e
11-
12-
# If CXX was not already set, then determine the newest clang.
13-
if [ ! -n "$CXX" ]; then
14-
for i in $(seq 40 -1 18); do
15-
if [ -f /usr/bin/clang++-${i} ]; then
16-
export CXX="/usr/bin/clang++-$i"
17-
export CC="/usr/bin/clang-$i"
18-
break
19-
fi
20-
done
21-
fi
22-
23-
set -x
10+
set -xe
2411

2512
if [ $# -eq 0 ]
2613
then
@@ -37,5 +24,6 @@ npm ci
3724
echo "Building docs in custom dir..."
3825
PATH="$(pwd)/node_modules/.bin:${PATH}"
3926
export PATH
40-
npx antora --clean --fetch "$PLAYBOOK"
27+
npx antora --clean --fetch "$PLAYBOOK" --stacktrace --log-level all
4128
echo "Done"
29+

0 commit comments

Comments
 (0)