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 9, 2024
1 parent fde1f0f commit 552adba
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
19 changes: 18 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,7 +372,18 @@ 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: |
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 552adba

Please sign in to comment.