diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 8ac79de..b99cbb8 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -1,21 +1,16 @@ -name: CMake on multiple platforms +name: CMake with Clang and Ninja on: - push: - pull_request: workflow_dispatch: - jobs: build: runs-on: ${{ matrix.os }} - strategy: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - build_type: [Release] - c_compiler: [clang, clang-cl] + build_type: [Release, Debug] include: - os: windows-latest c_compiler: clang-cl @@ -23,43 +18,35 @@ jobs: - os: ubuntu-latest c_compiler: clang cpp_compiler: clang++ - exclude: - - os: ubuntu-latest - c_compiler: clang-cl steps: - uses: actions/checkout@v4 - with: - submodules: recursive # Ensure submodules are cloned - - name: Set up Clang-Cl on Windows - if: runner.os == 'Windows' - shell: pwsh - run: | - echo "Setting up Clang-Cl..." - echo "CC=clang-cl" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - echo "CXX=clang-cl" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - echo "Using Clang Version:" - clang-cl --version + - name: Install Ninja (Linux) + if: runner.os == 'Linux' + run: sudo apt-get update && sudo apt-get install -y ninja-build + shell: bash - - name: Install Ninja on Windows + - name: Install Ninja (Windows) if: runner.os == 'Windows' - run: | - choco install ninja --no-progress - shell: pwsh + run: choco install ninja + shell: powershell - name: Configure CMake run: > cmake -B ${{ github.workspace }}/build - -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -G Ninja -S ${{ github.workspace }} + shell: bash - name: Build run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.build_type }} + shell: bash - name: Test working-directory: ${{ github.workspace }}/build run: ctest --build-config ${{ matrix.build_type }} + shell: bash