fix(ci): install latest clang version #235
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
name: Build | |
on: [push] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] #, macos-latest, windows-latest] | |
build-type: [release] | |
steps: | |
# Checkout the repository | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install LLVM Repository | |
run: | | |
wget https://apt.llvm.org/llvm.sh | |
chmod +x llvm.sh | |
sudo ./llvm.sh 18 | |
# Install system dependencies for Linux | |
- name: Install Linux dependencies | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y \ | |
libc++-dev libc++abi-dev \ | |
libpixman-1-dev libfreetype6-dev libharfbuzz-dev zlib1g-dev \ | |
libx11-dev libxcursor-dev libxi-dev libgl1-mesa-dev \ | |
libpthread-stubs0-dev | |
- name: Set up LLVM and Clang paths | |
run: | | |
echo "/usr/lib/llvm-18/bin" >> $GITHUB_PATH | |
echo "CC=/usr/bin/clang-18" >> $GITHUB_ENV | |
echo "CXX=/usr/bin/clang++-18" >> $GITHUB_ENV | |
- name: Debug LLVM Version | |
run: clang++ --version | |
# Install Ninja | |
- name: Install Ninja | |
uses: seanmiddleditch/gha-setup-ninja@master | |
with: | |
version: 1.12.1 | |
# Setup vcpkg | |
- name: Setup vcpkg | |
uses: lukka/run-vcpkg@v11 | |
with: | |
vcpkgGitCommitId: "cd124b84feb0c02a24a2d90981e8358fdee0e077" | |
# Select CMake preset based on OS and build type | |
- name: Select CMake Preset | |
id: select-preset | |
shell: bash | |
run: | | |
if [ "${{ runner.os }}" == "Windows" ]; then | |
case "${{ matrix.build-type }}" in | |
debug) echo "preset=win-debug" ;; | |
release) echo "preset=win-release" ;; | |
relwithdebinfo) echo "preset=win-relwithdebinfo" ;; | |
esac | |
else | |
case "${{ matrix.build-type }}" in | |
debug) echo "preset=unix-debug" ;; | |
release) echo "preset=unix-release" ;; | |
relwithdebinfo) echo "preset=unix-relwithdebinfo" ;; | |
esac | |
fi | tee -a $GITHUB_OUTPUT | |
# Configure the project | |
- name: Configure CMake | |
run: cmake --preset ${{ steps.select-preset.outputs.preset }} | |
env: | |
VCPKG_ROOT: ${{ github.workspace }}/vcpkg | |
CMAKE_THREAD_LIBS_INIT: -pthread | |
THREADS_PREFER_PTHREAD_FLAG: ON | |
# Build the project | |
- name: Build | |
run: cmake --build . --preset ${{ steps.select-preset.outputs.preset }} | |
env: | |
VCPKG_ROOT: ${{ github.workspace }}/vcpkg |