Skip to content

ci: testing more CMake versions #16

ci: testing more CMake versions

ci: testing more CMake versions #16

# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform.
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
name: test
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: false
# CMake versions under test are the versions available the supported lts versions of Ubuntu, and the latest version.
# Once support for a version is dropped, the minimum version can be updated.
matrix:
os: [ubuntu-latest, windows-latest]
build_type: [Release, Debug]
cmake_version: ['3.16.3', # 20.04 LTS
'3.22.1', # 22.04 LTS
'3.28.3', # 24.04 LTS
'3.30']
exclude:
- os: windows-latest
cmake_version: '3.16.3' # there seems to be a bug with compiler detection
steps:
- uses: actions/checkout@v4
- name: Set reusable strings
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Setup cmake
uses: jwlawson/[email protected]
with:
cmake-version: ${{ matrix.cmake_version }}
# print the cmake version
- name: Print CMake version
run: cmake --version
- name: Configure CMake
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S ${{ github.workspace }}
env:
CMAKE_VERSION: ${{ matrix.cmake_version }}
- name: Install
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --target install
env:
CMAKE_VERSION: ${{ matrix.cmake_version }}