lukka/run-cmake

Run CMake with CMakePreset.json to configure, build, package and test C/C++ source code.

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Activelast commit Jun 30, 2026
License
MIT

Pinned Snippet

workflow.ymlSHA-pinned
uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9

tags can be moved; commit SHAs can't. why a SHA?

namedescriptionrequireddefault
cmakeListsTxtPathPath to CMakeLists.txt.no${{ github.workspace }}/CMakeLists.txt
workflowPresetThe name of the workflow preset. Optional, it cannot be used with any other preset input. This value is stored in the WORKFLOW_PRESET_NAME environment variable, and used by the default value of 'workflowPresetCmdString' input.no""
configurePresetThe name of the configure preset. Optional, but at least one of the preset input must be provided. This value is stored in the CONFIGURE_PRESET_NAME environment variable, and used by the default value of 'configurePresetCmdString' input.no""
buildPresetThe name of the build preset. Optional, but at least one of the preset input must be provided. This value is stored in the BUILD_PRESET_NAME environment variable, and used by the default value of 'buildPresetCmdString' input.'no""
testPresetThe name of the test preset (ctest). Optional, but at least one of the preset input must be provided. This value is stored in the TEST_PRESET_NAME environment variable, and used by the default value of 'testPresetCmdString' input.'no""
packagePresetThe name of the package preset (cpack). Optional, but at least one of the preset input must be provided. This value is stored in the PACKAGE_PRESET_NAME environment variable, and used by the default value of 'packagePresetCmdString' input.'no""
configurePresetAdditionalArgsA string representing list of additional arguments for configuring. Optional. Useful when specifing additional variables such as, e.g., ['-DVARIABLE=NAME', '-DANOTHERVARIABLE=ANOTHERNAME']no[]
buildPresetAdditionalArgsA string representing list of additional arguments for building. Optional. Useful when specifing the config to build with a multi configuration generator, e.g., ['--config DEBUG']no[]
testPresetAdditionalArgsA string representing list of additional arguments for testing. Optional. Useful when specifing the config to test with a multi configuration generator, e.g., ['--config DEBUG']no[]
packagePresetAdditionalArgsA string representing list of additional arguments for cpack. Optional.no[]
useShellSpecify which shell to be used when launching commands. 'true' means the default shell is used. 'false' means no shell is used. It also can be an absolute with arguments of the shell to spawn commands with.notrue
logCollectionRegExpsSpecifies a semicolon separated list of regular expressions that are used to identify log file paths in the workflow output. A regular expression must have a single capturing group, that is a single pair of parenthesis such as 'See also (.+.log)'. When a match occurs, the content of the file is written into the workflow output for disclosing its content to the user. The default regular expressions are for CMake's and vcpkg's log files.no\s*"(.+CMakeOutput\.log)"\.\s*;\s*"(.+CMakeError\.log)"\.\s*;\s*(.+out\.log)\s*;\s+(.+err\.log)\s*;\s*(.+vcpkg.+\.log)\s*
workflowPresetCmdStringThe CMake command format string to run the workflow steps.no[`--workflow`, `--preset`, `$[env.WORKFLOW_PRESET_NAME]`, `--fresh`]
configurePresetCmdStringThe CMake command format string to configure and generate project files.no[`--preset`, `$[env.CONFIGURE_PRESET_NAME]`]
buildPresetCmdStringThe CMake command format string to run the build.no[`--build`, `--preset`, `$[env.BUILD_PRESET_NAME]`]
testPresetCmdStringThe CTest command format string to run test.no[`--preset`, `$[env.TEST_PRESET_NAME]`]
packagePresetCmdStringThe CPack command format string to package the project.no[`--preset`, `$[env.PACKAGE_PRESET_NAME]`]
runVcpkgEnvFormatStringSpecify the command line to dump the environment variables with the 'vcpkg env' command. This command is only used when setting up the environment for MSVC on Windows.no[`env`, `--bin`, `--include`, `--tools`, `--python`, `--triplet`, `$[env.VCPKG_DEFAULT_TRIPLET]`, `set`]

no outputs