Skip to content

Commit

Permalink
update doc scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ashtum committed Jan 6, 2025
1 parent b4db8fa commit 8a00068
Show file tree
Hide file tree
Showing 13 changed files with 919 additions and 70,805 deletions.
104 changes: 91 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1113,32 +1113,110 @@ jobs:
tag-pattern: 'boost-.*\..*\..*'

antora:
name: Antora Docs
runs-on: ubuntu-latest
needs: [ runner-selection ]
strategy:
matrix:
include:
# - { name: Windows, os: windows-latest }
- { name: Ubuntu, os: ubuntu-latest }
- { name: MacOS, os: macos-latest }
name: Antora Docs (${{ matrix.name }})
runs-on: ${{ fromJSON(needs.runner-selection.outputs.labelmatrix)[matrix.os] }}
defaults:
run:
shell: bash
steps:
- name: Clone Http.Proto
- name: Install packages
uses: alandefreitas/cpp-actions/[email protected]
with:
apt-get: git cmake

- name: Clone Boost.Http.Proto
uses: actions/checkout@v3
with:
path: http-proto-root

- uses: actions/setup-node@v3
- name: Clone Boost.Buffers
uses: actions/checkout@v3
with:
node-version: 18
path: buffers-root
repository: cppalliance/buffers
ref: develop

- name: Setup C++
uses: alandefreitas/cpp-actions/setup-cpp@v1.8.7
id: setup-cpp
- name: Clone Boost
uses: alandefreitas/cpp-actions/boost-clone@v1.8.7
id: boost-clone
with:
compiler: clang
version: 18
branch: ${{ (github.ref_name == 'master' && github.ref_name) || 'develop' }}
boost-dir: boost-source
scan-modules-dir: http-proto-root
scan-modules-ignore: http_proto

- name: Build Antora Docs
- name: Patch Boost
id: patch
shell: bash
run: |
set -xe
pwd
ls
ls -lah boost-source
# Identify boost module being tested
module=${GITHUB_REPOSITORY#*/}
echo "module=$module" >> $GITHUB_OUTPUT
# Identify GitHub workspace root
workspace_root=$(echo "$GITHUB_WORKSPACE" | sed 's/\\/\//g')
echo -E "workspace_root=$workspace_root" >> $GITHUB_OUTPUT
# Remove module from boost-source
rm -r "boost-source/libs/$module" || true
# Copy cached boost-source to an isolated boost-root
cp -r boost-source boost-root
# Set boost-root output
cd boost-root
boost_root="$(pwd)"
boost_root=$(echo "$boost_root" | sed 's/\\/\//g')
echo -E "boost_root=$boost_root" >> $GITHUB_OUTPUT
# Patch boost-root with workspace module
cp -r "$workspace_root"/http-proto-root "libs/$module"
cp -r "$workspace_root"/buffers-root libs/buffers
python3 tools/boostdep/depinst/depinst.py buffers
python3 tools/boostdep/depinst/depinst.py http_proto
- uses: actions/setup-node@v4
with:
node-version: 18

- name: Setup Ninja
if: runner.os == 'Windows'
uses: seanmiddleditch/gha-setup-ninja@v5

- name: Build Antora Docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global --add safe.directory "$(pwd)"
BOOST_SRC_DIR="$(pwd)/boost-root"
export BOOST_SRC_DIR
cd boost-root/libs/http_proto
cd doc
bash ./build_antora.sh
# Antora returns zero even if it fails, so we check if the site directory exists
if [ ! -d "build/site" ]; then
echo "Antora build failed"
exit 1
fi
- name: Create Antora Docs Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: antora-docs
name: antora-docs-${{ matrix.name }}
path: doc/build/site
7 changes: 2 additions & 5 deletions doc/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,5 @@ asciidoc:
nav:
- modules/ROOT/nav.adoc
ext:
collector:
run:
command: node doc/generate-files.mjs
scan:
dir: doc/build/generated-files
cpp-reference:
config: doc/mrdocs.yml
2 changes: 1 addition & 1 deletion doc/build_antora.bat
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ call "C:\Program Files\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
set "PATH=%PATH%;C:\Program Files\7-Zip"
set "PATH=%PATH%;%CD%\node_modules\.bin"
call npx antora --clean --fetch "%PLAYBOOK%"
call npx antora --clean --fetch "%PLAYBOOK%" --stacktrace --log-level all
echo Done
18 changes: 3 additions & 15 deletions doc/build_antora.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,7 @@
# Official repository: https://github.com/boostorg/url
#

set -e

# If CXX was not already set, then determine the newest clang.
if [ ! -n "$CXX" ]; then
for i in $(seq 40 -1 18); do
if [ -f /usr/bin/clang++-${i} ]; then
export CXX="/usr/bin/clang++-$i"
export CC="/usr/bin/clang-$i"
break
fi
done
fi

set -x
set -xe

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

Loading

0 comments on commit 8a00068

Please sign in to comment.