From 73b8f7b069a22046db525d55c1cb0d4a71f2b7f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Thu, 26 Sep 2024 15:45:33 +0200 Subject: [PATCH] Use Ninja --- .github/workflows/build.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0e260ed..1c722f5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,6 +5,8 @@ on: - main pull_request: types: [opened, synchronize, reopened] +env: + CLANG_VERSION: 18 jobs: build: name: Build @@ -15,10 +17,22 @@ jobs: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: Install sonar-scanner uses: sonarsource/sonarcloud-github-c-cpp@v3 - - name: Generate compilation database + - name: Install Ninja + run: | + wget https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-linux.zip + sudo unzip ninja-linux.zip -d /usr/local/bin + - name: Install clang + run: | + sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ${{env.CLANG_VERSION}} + sudo apt install -y clang-tools-${{env.CLANG_VERSION}} libc++-${{env.CLANG_VERSION}}-dev + - name: Generate compilation database and build run: | mkdir build - cmake -S . -B build + cmake -S . -B build -G Ninja \ + -DCMAKE_CXX_COMPILER=clang++-${{env.CLANG_VERSION}} \ + -DCMAKE_CXX_COMPILER_CLANG_SCAN_DEPS=clang-scan-deps-${{env.CLANG_VERSION}} + # The project needs to be built so the `.modmap` files are generated + cmake --build build --target all - name: Run sonar-scanner env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}