Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
play

GitHub Action

actions-setup-cmake

v1.7

actions-setup-cmake

play

actions-setup-cmake

Setup the cmake build generator

Installation

Copy and paste the following snippet into your .yml file.

              

- name: actions-setup-cmake

uses: jwlawson/actions-setup-cmake@v1.7

Learn more about this action in jwlawson/actions-setup-cmake

Choose a version

Setup cmake for GitHub Actions

Github action to setup the cmake build script generator.

This action will update the path for your workflow to include cmake matching the platform and version requirements.

Usage

Adding a step that uses this action to your workflow will setup cmake and make it available to subsequent steps:

jobs:
  example:
    runs-on: ubuntu-latest
    steps:
    - name: Setup cmake
      uses: jwlawson/actions-setup-cmake@v1.7
      with:
        cmake-version: '3.16.x'
    - name: Use cmake
      run: cmake --version

Options

There are two options for the action:

  • cmake-version controls the version of CMake that is added to the path. This can be a fully specified verison 3.3.0, partly specified 3.2, a wildcard version 3.2.x. By default it is empty which will give the latest CMake version available on GitHub.

    The version tests show some expected values for given versions.

  • github-api-token is optional, but is used to authenticate with GitHub's API. By default it will use the token generated by the workflow. If set to blank then no authentication is used to access the API and there is a chance that the test runner will have hit the API rate limit causing the action to fail to download the available versions from GitHub.

    See also:

How it works

The action will download the list of releases of CMake available on GitHub and choose the best match for the test runner's platform and the version requirements given as as option. The CMake package is then either downloaded from GitHub, or a cached version from the action's tool cache is used, and the executables are provided on the path for subsequent workflow steps.