name: CMake compatibility check

on:
  workflow_dispatch:

jobs:
  check:
    strategy:
      fail-fast: false
      matrix:
        cmake_ver:
          - 3.31.5
          - 3.30.7
          - 3.29.9
          - 3.28.6
          - 3.27.9
          - 3.26.6
          - 3.25.3
          - 3.24.4
          - 3.23.5
          - 3.22.6
          - 3.21.7
          - 3.20.6
          - 3.19.8
          - 3.18.6
          - 3.17.5
          # - 3.16.9
          # - 3.15.7
          # - 3.14.7
          # - 3.13.5
          # - 3.12.4
          # - 3.11.4
          # - 3.10.3
          # - 3.9.6
          # - 3.8.2
          # - 3.7.2
          # - 3.6.3
          # - 3.5.2
          # - 3.4.3
          # - 3.3.2
          # - 3.2.3
          # - 3.1.3
          # - 3.0.2
    runs-on: ubuntu-24.04
    steps:
    - uses: actions/checkout@v4

    - uses: lukka/get-cmake@latest
      with:
        cmakeVersion: ${{ matrix.cmake_ver }}
        ninjaVersion: latest

    - name: Install prerequisites
      run: |
        sudo apt-get -qy update
        sudo -E DEBIAN_FRONTEND=noninteractive apt-get -qy install libglib2.0-dev

    - name: Check cmake invocation
      run: |
        mkdir build
        cmake -S . -B build -G Ninja

