build_docs: an antora variable modification #53
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# Copyright 2022 Sam Darwin | |
# | |
# Distributed under the Boost Software License, Version 1.0. | |
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) | |
name: build_docs | |
on: | |
pull_request: | |
paths: | |
- 'build_docs/**' | |
- '.github/workflows/build_docs.yml' | |
push: | |
paths: | |
- 'build_docs/**' | |
- '.github/workflows/build_docs.yml' | |
branches: | |
- master | |
- develop | |
- feature/** | |
jobs: | |
linux: | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
container: ubuntu:24.04 | |
packages: python-is-python3 | |
skiplist: auto_index geometry | |
flags: --debug | |
- os: ubuntu-latest | |
container: ubuntu:22.04 | |
packages: python2 | |
skiplist: auto_index geometry url | |
flags: --debug | |
- os: ubuntu-latest | |
container: ubuntu:20.04 | |
packages: python | |
skiplist: auto_index geometry url | |
flags: --debug | |
- os: ubuntu-latest | |
container: ubuntu:24.04 | |
packages: python-is-python3 | |
skiplist: geometry url | |
flags: --debug --boostrelease | |
- os: ubuntu-latest | |
container: ubuntu:22.04 | |
packages: python2 | |
skiplist: geometry url | |
flags: --debug --boostrelease | |
- os: ubuntu-latest | |
container: ubuntu:20.04 | |
packages: python | |
skiplist: geometry url | |
flags: --debug --boostrelease | |
# Jinja 3.1.0 and later have dropped support for Python 3.6 and therefore won't run on Ubuntu 18.04. Removing tests for Ubuntu 18. | |
timeout-minutes: 720 | |
runs-on: ${{matrix.os}} | |
container: ${{matrix.container}} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: docs | |
run: | | |
set -x | |
set -e | |
export EXPORT_BOOST_SRC_DIR="yes" | |
touch /tmp/failed.txt | |
touch /tmp/succeeded.txt | |
apt-get update | |
DEBIAN_FRONTEND="noninteractive" apt-get install -y tzdata | |
apt-get install -y git sudo | |
apt-get install -y ${{ matrix.packages }} | |
if [ ! -f /usr/bin/python ]; then | |
ln -s /usr/bin/python2 /usr/bin/python | |
fi | |
cp build_docs/linuxdocs.sh /usr/local/bin/ | |
mkdir -p /opt/github/boostorg | |
cd /opt/github/boostorg | |
git clone -b "develop" --depth 1 "https://github.com/boostorg/boost.git" | |
cd boost | |
git submodule update --init | |
# Run at least one full build that installs everything | |
cd libs/accumulators | |
linuxdocs.sh ${{ matrix.flags }} | |
cd ../.. | |
# Run at least one antora build that installs everything | |
cd libs/url | |
linuxdocs.sh ${{ matrix.flags }} | |
cd ../.. | |
textpart1='#!/bin/bash | |
reponame=$1 | |
echo "reponame is $reponame" | |
skiplist="' | |
textpart2="${{ matrix.skiplist }}" | |
textpart3='" | |
# jump ahead to continue testing | |
# if [[ "$reponame" =~ ^[a-fh-z] ]]; then | |
if [[ "$reponame" =~ ^[9] ]]; then | |
echo "skipping ahead X letters" | |
elif [[ "$skiplist" =~ $reponame ]]; then | |
echo "repo in skiplist" | |
else | |
linuxdocs.sh --quick ' | |
textpart4="${{ matrix.flags }}" | |
textpart5=' | |
if [[ $? != 0 ]]; then | |
echo "..failed. DOCS BUILD FAILED. LIBRARY $reponame" | |
echo "$reponame" >> /tmp/failed.txt | |
else | |
echo "LIBRARY $reponame SUCCEEDED." | |
echo "$reponame" >> /tmp/succeeded.txt | |
fi | |
fi | |
' | |
textsource="${textpart1}${textpart2}${textpart3}${textpart4}${textpart5}" | |
echo "$textsource" > /usr/local/bin/runlinuxdocsquick | |
chmod 755 /usr/local/bin/runlinuxdocsquick | |
echo "checking runlinuxdocsquick" | |
cat /usr/local/bin/runlinuxdocsquick | |
git submodule foreach 'runlinuxdocsquick $name' | |
failed=$(wc -l /tmp/failed.txt | cut -d" " -f1) | |
succeeded=$(wc -l /tmp/succeeded.txt | cut -d" " -f1) | |
echo "$failed failed, $succeeded succeeded." | |
echo "" | |
cat /tmp/failed.txt | |
if [ "$failed" != "0" ]; then | |
exit 1 | |
fi | |
macos: | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# - os: macos-11 | |
# skiplist: auto_index contract | |
# - os: macos-11 | |
# skiplist: contract | |
# flags: --debug --boostrelease | |
- os: macos-12 | |
skiplist: auto_index contract geometry url | |
flags: --debug | |
- os: macos-12 | |
skiplist: contract geometry url | |
flags: --debug --boostrelease | |
- os: macos-14 | |
skiplist: auto_index contract geometry url | |
flags: --debug | |
- os: macos-14 | |
skiplist: contract geometry url | |
flags: --debug --boostrelease | |
timeout-minutes: 720 | |
runs-on: ${{matrix.os}} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: docs | |
run: | | |
set -x | |
set -e | |
export EXPORT_BOOST_SRC_DIR="yes" | |
touch /tmp/failed.txt | |
touch /tmp/succeeded.txt | |
cp build_docs/macosdocs.sh /usr/local/bin/ | |
mkdir -p github/boostorg | |
cd github/boostorg | |
git clone -b "develop" --depth 1 "https://github.com/boostorg/boost.git" | |
cd boost | |
git submodule update --init | |
# Run at least one full build that installs everything | |
cd libs/system | |
macosdocs.sh | |
cd ../.. | |
# Run at least one antora build that installs everything | |
# cd libs/url | |
# macosdocs.sh | |
# cd ../.. | |
textpart1='#!/bin/bash | |
reponame=$1 | |
echo "reponame is $reponame" | |
skiplist="' | |
textpart2="${{ matrix.skiplist }}" | |
textpart3='" | |
# jump ahead to continue testing | |
# if [[ "$reponame" =~ ^[a-s] ]]; then | |
if [[ "$reponame" =~ ^[9] ]]; then | |
echo "skipping ahead X letters" | |
elif [[ "$skiplist" =~ $reponame ]]; then | |
echo "repo in skiplist" | |
else | |
macosdocs.sh --quick ' | |
textpart4="${{ matrix.flags }}" | |
textpart5=' | |
if [[ $? != 0 ]]; then | |
echo "..failed. DOCS BUILD FAILED. LIBRARY $reponame" | |
# exit 1 | |
echo "$reponame" >> /tmp/failed.txt | |
else | |
echo "LIBRARY $reponame SUCCEEDED." | |
echo "$reponame" >> /tmp/succeeded.txt | |
fi | |
fi | |
' | |
textsource="${textpart1}${textpart2}${textpart3}${textpart4}${textpart5}" | |
echo "$textsource" > /usr/local/bin/runmacosdocsquick | |
chmod 755 /usr/local/bin/runmacosdocsquick | |
echo "check runmacosdocsquick" | |
cat /usr/local/bin/runmacosdocsquick | |
git submodule foreach 'runmacosdocsquick $name' | |
failed=$(wc -l /tmp/failed.txt | tr -s ' ' | cut -d' ' -f2) | |
succeeded=$(wc -l /tmp/succeeded.txt | tr -s ' ' | cut -d' ' -f2) | |
echo "$failed failed, $succeeded succeeded." | |
echo "" | |
cat /tmp/failed.txt | |
if [ "$failed" != "0" ]; then | |
exit 1 | |
fi | |
windows: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: windows-2019 | |
skiplist: auto_index contract hana leaf log parameter parameter_python python qvm url | |
- os: windows-2022 | |
skiplist: auto_index contract hana log parameter parameter_python python url | |
- os: windows-2019 | |
flags: "-boostrelease" | |
skiplist: contract hana log parameter parameter_python python url | |
- os: windows-2022 | |
flags: "-boostrelease" | |
skiplist: contract hana log parameter parameter_python python url | |
timeout-minutes: 720 | |
runs-on: ${{matrix.os}} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: docs | |
shell: powershell | |
run: | | |
$env:EXPORT_BOOST_SRC_DIR="yes" | |
echo $null >> C:\succeeded.txt | |
echo $null >> C:\failed.txt | |
function Runwindowsdocs { | |
echo 'In Runwindowsdocs function' | |
pwd | |
windowsdocs.ps1 | |
if ( ! $LASTEXITCODE -eq 0) { | |
echo '..failed. Runwindowsdocs pre-build FAILED.' | |
pwd | |
# exit 1 | |
} | |
else { | |
echo "Runwindowsdocs pre-build SUCCEEDED." | |
pwd | |
} | |
} | |
# 'git submodule foreach' isn't seeing declared functions. | |
# As a workaround, place the function in a module. Load the module at runtime. | |
New-Item -ItemType Directory -Force -Path C:\scripts | |
$textpart1=@' | |
param( [String]$reponame) | |
pwd | |
echo "reponame is $reponame" | |
# need to research all skipped libraries. | |
$skiplist=" | |
'@ | |
$textpart2="${{ matrix.skiplist }}" | |
$textpart3=@' | |
" | |
# if ( $reponame -match '^[a-o]' ) { | |
if ( $reponame -match '^[9]' ) { | |
echo "skipping ahead X letters" | |
} | |
elseif ($skiplist -like "*$reponame*") { | |
echo "repo in skiplist" | |
} | |
else { | |
windowsdocs.ps1 -quick | |
'@ | |
$textpart4="${{ matrix.flags }}" | |
$textpart5=@' | |
if ( ! $LASTEXITCODE -eq 0) { | |
echo "..failed. DOCS BUILD FAILED. LIBRARY $reponame" | |
echo "doc build failed in github actions. exiting." | |
Add-Content C:\failed.txt "`n$reponame" | |
# exit 1 | |
} | |
else { | |
echo "LIBRARY $reponame SUCCEEDED." | |
Add-Content C:\succeeded.txt "`n$reponame" | |
} | |
} | |
'@ | |
$textsource="${textpart1}${textpart2}${textpart3}${textpart4}${textpart5}" | |
$textsource | Out-File c:\scripts\cifunctions.ps1 | |
echo "Checking cifunctions.ps1" | |
cat c:\scripts\cifunctions.ps1 | |
cp build_docs/windowsdocs.ps1 C:\windows\system32 | |
echo "job" | |
mkdir C:\boostorg | |
cd C:\boostorg | |
git clone -b develop --depth 1 https://github.com/boostorg/boost.git boost | |
cd boost | |
git submodule update --init | |
# Run at least one full build that installs everything | |
cd libs/system | |
Runwindowsdocs | |
cd ../.. | |
# Run at least one antora build that installs everything | |
# cd libs/url | |
# Runwindowsdocs | |
# cd ../.. | |
# For the rest --quick | |
git submodule foreach 'powershell -command C:/scripts/cifunctions.ps1 $name' | |
$succeeded = (Get-Content C:\succeeded.txt | Measure-Object -Line).Lines | |
$failed = (Get-Content C:\failed.txt | Measure-Object -Line).Lines | |
echo "$failed failed, $succeeded succeeded." | |
Get-Content C:\failed.txt | |
if ( $failed -ne '0' ) { | |
exit 1 | |
} | |