Skip to content

Commit b3e58a3

Browse files
committed
fix(ci): pin clang-format 17 in multi-language-client cpp job
ubuntu-latest ships clang-format 18.x which breaks Spotless when clang.format.version is 17.0.6. Install LLVM 17 clang-format on Linux, macOS, and Windows like refactor/cpp-client-sdk.
1 parent 99befda commit b3e58a3

1 file changed

Lines changed: 28 additions & 4 deletions

File tree

.github/workflows/multi-language-client.yml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,32 @@ jobs:
5555
if: matrix.os == 'ubuntu-latest'
5656
shell: bash
5757
run: |
58+
set -euxo pipefail
5859
sudo apt-get update
59-
sudo apt-get install libboost-all-dev
60+
sudo apt-get install -y libboost-all-dev openssl libssl-dev wget
61+
# Pin clang-format 17 to match pom.xml clang.format.version (ubuntu-latest ships 18.x)
62+
. /etc/os-release
63+
if [[ "${VERSION_CODENAME}" == "jammy" ]]; then
64+
wget -qO /tmp/llvm.sh https://apt.llvm.org/llvm.sh
65+
chmod +x /tmp/llvm.sh
66+
sudo DEBIAN_FRONTEND=noninteractive /tmp/llvm.sh 17
67+
sudo apt-get install -y clang-format-17
68+
else
69+
sudo apt-get install -y clang-format-17
70+
fi
71+
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-17 100
72+
sudo update-alternatives --set clang-format /usr/bin/clang-format-17
73+
clang-format --version
6074
- name: Install CPP Dependencies (Mac)
6175
# remove some xcode to release disk space
6276
if: matrix.os == 'macos-latest'
6377
shell: bash
6478
run: |
65-
brew install boost
79+
brew install boost openssl llvm@17 bison
80+
ln -sf "$(brew --prefix llvm@17)/bin/clang-format" "$(brew --prefix)/bin/clang-format"
81+
echo "$(brew --prefix bison)/bin" >> "$GITHUB_PATH"
82+
echo "$(brew --prefix llvm@17)/bin" >> "$GITHUB_PATH"
83+
clang-format --version
6684
sudo rm -rf /Applications/Xcode_14.3.1.app
6785
sudo rm -rf /Applications/Xcode_15.0.1.app
6886
sudo rm -rf /Applications/Xcode_15.1.app
@@ -71,10 +89,16 @@ jobs:
7189
- name: Install CPP Dependencies (Windows)
7290
if: matrix.os == 'windows-latest'
7391
run: |
74-
choco install winflexbison3
75-
choco install boost-msvc-14.3
92+
choco install winflexbison3 -y
93+
choco install boost-msvc-14.3 -y
7694
$boost_path = (Get-ChildItem -Path 'C:\local\' -Filter 'boost_*').FullName
7795
echo $boost_path >> $env:GITHUB_PATH
96+
choco install openssl -y
97+
$sslPath = (Get-ChildItem 'C:\Program Files\OpenSSL*' -Directory | Select-Object -First 1).FullName
98+
echo "$sslPath\bin" >> $env:GITHUB_PATH
99+
echo "OPENSSL_ROOT_DIR=$sslPath" >> $env:GITHUB_ENV
100+
choco install llvm --version=17.0.6 --force -y
101+
clang-format --version
78102
- name: Cache Maven packages
79103
uses: actions/cache@v4
80104
with:

0 commit comments

Comments
 (0)