GitHub Action
actions-setup-cmake
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.
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/[email protected]
with:
cmake-version: '3.16.x'
- name: Use cmake
run: cmake --version
There are three options for the action:
-
cmake-version
controls the version of CMake that is added to the path. This can be a fully specified verison3.3.0
, partly specified3.2
, a wildcard version3.2.x
. By default it is empty which will give the latest CMake version available on GitHub.The version can also be specified to be
latest
which is equivalent to leaving it blank and will give the latest version.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:
-
use-32bit
forces the use of a 32 bit binary, instead of first looking for a 64 bit binary. Note that more recent releases of cmake only have 32 bit packages for windows and not for linux or macos, so this option may cause failures in those cases.Possible values are
true
orfalse
. The default isfalse
.
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.