Skip to content

Commit

Permalink
ci: antora workflow sets up clang 18
Browse files Browse the repository at this point in the history
  • Loading branch information
alandefreitas committed Jul 10, 2024
1 parent 9460dda commit 95e50b8
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
25 changes: 24 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
with:
apt-get: git cmake

- name: Clone Boost.URL
uses: actions/checkout@v4

Expand All @@ -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
Expand Down
8 changes: 8 additions & 0 deletions doc/generate-files.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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})`)
Expand Down

0 comments on commit 95e50b8

Please sign in to comment.