Skip to content

Commit 93bd44f

Browse files
committed
update doc scripts
1 parent 9944bae commit 93bd44f

File tree

11 files changed

+922
-70798
lines changed

11 files changed

+922
-70798
lines changed

.github/workflows/ci.yml

Lines changed: 98 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,37 +1016,119 @@ jobs:
10161016
tag-pattern: 'boost-.*\..*\..*'
10171017

10181018
antora:
1019-
name: Antora Docs
1020-
runs-on: ubuntu-latest
1019+
needs: [ runner-selection ]
1020+
strategy:
1021+
matrix:
1022+
include:
1023+
# - { name: Windows, os: windows-latest }
1024+
- { name: Ubuntu, os: ubuntu-latest }
1025+
- { name: MacOS, os: macos-latest }
1026+
name: Antora Docs (${{ matrix.name }})
1027+
runs-on: ${{ fromJSON(needs.runner-selection.outputs.labelmatrix)[matrix.os] }}
1028+
defaults:
1029+
run:
1030+
shell: bash
10211031
steps:
1032+
- name: Install packages
1033+
uses: alandefreitas/cpp-actions/[email protected]
1034+
with:
1035+
apt-get: git cmake
1036+
10221037
- name: Clone Boost.Http.Io
10231038
uses: actions/checkout@v3
1039+
with:
1040+
path: http-io-root
10241041

1025-
- uses: actions/setup-node@v3
1042+
- name: Clone Boost.Http.Proto
1043+
uses: actions/checkout@v3
10261044
with:
1027-
node-version: 18
1045+
repository: cppalliance/http_proto
1046+
path: http-proto-root
1047+
ref: develop
10281048

1029-
- name: Setup C++
1030-
uses: alandefreitas/cpp-actions/[email protected]
1031-
id: setup-cpp
1049+
- name: Clone Boost.Buffers
1050+
uses: actions/checkout@v3
10321051
with:
1033-
compiler: clang
1034-
version: 18
1052+
path: buffers-root
1053+
repository: cppalliance/buffers
1054+
ref: develop
10351055

1036-
- name: Build Antora Docs
1056+
- name: Clone Boost
1057+
uses: alandefreitas/cpp-actions/[email protected]
1058+
id: boost-clone
1059+
with:
1060+
branch: ${{ (github.ref_name == 'master' && github.ref_name) || 'develop' }}
1061+
boost-dir: boost-source
1062+
scan-modules-dir: http-io-root
1063+
scan-modules-ignore: http_io
1064+
1065+
- name: Patch Boost
1066+
id: patch
1067+
shell: bash
10371068
run: |
10381069
set -xe
1070+
pwd
1071+
ls
1072+
ls -lah boost-source
1073+
1074+
# Identify boost module being tested
1075+
module=${GITHUB_REPOSITORY#*/}
1076+
echo "module=$module" >> $GITHUB_OUTPUT
10391077
1040-
CXX="/usr/bin/clang++-18"
1041-
export CXX
1042-
CC="/usr/bin/clang-18"
1043-
export CC
1078+
# Identify GitHub workspace root
1079+
workspace_root=$(echo "$GITHUB_WORKSPACE" | sed 's/\\/\//g')
1080+
echo -E "workspace_root=$workspace_root" >> $GITHUB_OUTPUT
10441081
1082+
# Remove module from boost-source
1083+
rm -r "boost-source/libs/$module" || true
1084+
1085+
# Copy cached boost-source to an isolated boost-root
1086+
cp -r boost-source boost-root
1087+
1088+
# Set boost-root output
1089+
cd boost-root
1090+
boost_root="$(pwd)"
1091+
boost_root=$(echo "$boost_root" | sed 's/\\/\//g')
1092+
echo -E "boost_root=$boost_root" >> $GITHUB_OUTPUT
1093+
1094+
# Patch boost-root with workspace module
1095+
cp -r "$workspace_root"/http-io-root "libs/$module"
1096+
cp -r "$workspace_root"/buffers-root libs/buffers
1097+
cp -r "$workspace_root"/http-proto-root libs/http_proto
1098+
1099+
python3 tools/boostdep/depinst/depinst.py buffers
1100+
python3 tools/boostdep/depinst/depinst.py http_proto
1101+
python3 tools/boostdep/depinst/depinst.py http_io
1102+
1103+
- uses: actions/setup-node@v4
1104+
with:
1105+
node-version: 18
1106+
1107+
- name: Setup Ninja
1108+
if: runner.os == 'Windows'
1109+
uses: seanmiddleditch/gha-setup-ninja@v5
1110+
1111+
- name: Build Antora Docs
1112+
env:
1113+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1114+
run: |
1115+
git config --global --add safe.directory "$(pwd)"
1116+
1117+
BOOST_SRC_DIR="$(pwd)/boost-root"
1118+
export BOOST_SRC_DIR
1119+
cd boost-root/libs/http_io
1120+
10451121
cd doc
10461122
bash ./build_antora.sh
1123+
1124+
# Antora returns zero even if it fails, so we check if the site directory exists
1125+
if [ ! -d "build/site" ]; then
1126+
echo "Antora build failed"
1127+
exit 1
1128+
fi
10471129
10481130
- name: Create Antora Docs Artifact
1049-
uses: actions/upload-artifact@v3
1131+
uses: actions/upload-artifact@v4
10501132
with:
1051-
name: antora-docs
1133+
name: antora-docs-${{ matrix.name }}
10521134
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

0 commit comments

Comments
 (0)