diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 08c97bf6c..a73b4cf3c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -353,7 +353,13 @@ jobs: name: Antora Docs needs: [ runner-selection ] runs-on: ${{ fromJSON(needs.runner-selection.outputs.labelmatrix)['ubuntu-latest'] }} + container: ubuntu:23.10 steps: + - name: Install packages + uses: alandefreitas/cpp-actions/package-install@v1.8.3 + with: + apt-get: git cmake + - name: Clone Boost.URL uses: actions/checkout@v4 @@ -366,12 +372,29 @@ jobs: id: setup-cpp with: compiler: clang - version: 17 + version: 18 + + - name: Set environment variables + run: | + set -x + clangpp_path="$(which clang++-18)" + clang_path="$(which clang-18)" + echo "CXX_COMPILER=$clangpp_path" >> $GITHUB_ENV + echo "CXX=$clang_path" >> $GITHUB_ENV + echo "C_COMPILER=$clang_path" >> $GITHUB_ENV + echo "CC=$clang_path" >> $GITHUB_ENV + git config --global --add safe.directory "$(pwd)" - name: Build Antora Docs run: | 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@v4 diff --git a/doc/generate-files.mjs b/doc/generate-files.mjs index 1f4a717a3..d434db8f6 100644 --- a/doc/generate-files.mjs +++ b/doc/generate-files.mjs @@ -100,12 +100,20 @@ if (cxxCompiler && process.platform === "win32") { // Replace "\" with "/" in CXX_COMPILER cxxCompiler = cxxCompiler.replace(/\\/g, '/') } +if (cxxCompiler === undefined) { + console.error('Could not find a C++ compiler. Please set the CXX_COMPILER environment variable.') + process.exit(1) +} const cxxCompilerName = path.basename(cxxCompiler).replace(/\.exe$/, '') let cCompiler = findExecutable(['clang', 'gcc', 'cl']) || process.env.C_COMPILER || process.env.CC if (cCompiler && process.platform === "win32") { // Replace "\" with "/" in CXX_COMPILER cCompiler = cCompiler.replace(/\\/g, '/') } +if (cCompiler === undefined) { + console.error('Could not find a C compiler. Please set the C_COMPILER environment variable.') + process.exit(1) +} const cCompilerName = path.basename(cCompiler).replace(/\.exe$/, '') console.log(`C++ compiler: ${cxxCompilerName} (${cxxCompiler})`)