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

Action Status

Build C++ software with the multi-platform run-cmake action by running CMake on GitHub workflows. Samples provided use GitHub hosted runners and Caching.

Good companions are the run-vcpkg action and the get-cmake action.

User Manual

Developer Manual

It is highly recommended to use vcpkg as a submodule. Here below the sample where vcpkg is stored in a Git submodule:

  # Sample when vcpkg is a submodule of your repository (highly recommended!)

    # Cache/Restore the vcpkg's build artifacts.
    - name: Run vcpkg
      uses: lukka/run-vcpkg@v4
      with:
       # Response file stored in source control, it provides the list of ports and triplet(s).
        vcpkgArguments: '@${{ env.vcpkgResponseFile }}'
       # Location of the vcpkg as submodule of the repository.
        vcpkgDirectory: '${{ github.workspace }}/vcpkg'

    - name: 'Run CMake with Ninja'
      uses: lukka/run-cmake@v3
      with:
        cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
        cmakeListsTxtPath: '${{ github.workspace }}/cmakesettings.json/CMakeLists.txt'
        useVcpkgToolchainFile: true
        buildDirectory: '${{ runner.workspace }}/b//unixmakefiles'
        cmakeAppendedArgs: '-GNinja '
        # Or build multiple configurations out of a CMakeSettings.json file created with Visual Studio.
        # cmakeListsOrSettingsJson: CMakeSettingsJson
        # cmakeSettingsJsonPath: '${{ github.workspace }}/cmakesettings.json/CMakeSettings.json'
        # configurationRegexFilter: '${{ matrix.configuration }}'

run-cmake flowchart

This action behaves the same way as it does the run-cmake task for Azure DevOps.

The documentation of the 'run-cmake" action is identical to the 'run-cmake' task's one for Azure DevOps.

Features available only in the GitHub version of 'run-cmake':

  • Annotations for CMake errors/warnings and for build (gcc/msvc/clang) errors/warning are created inline in the changed source files the build run for, e.g.: Annotation

action.yml

View the workflows based on the run-cmake and run-vcpkg actions.

CMakeLists.txt samples
Linux/macOS/Windows, hosted runner, basic Actions Status
Linux/macOS/Windows, hosted runner, advanced Actions Status
Linux/macOS/Windows, hosted runner, with cache and vcpkg as submodule Actions Status
CMakeSettings.json samples
Linux/macOS/Windows, hosted runner, with cache and vcpkg as submodule Actions Status
project: CppOpenGLWebAssemblyCMake
WASM/Linux/macOS Actions Status
project: quiniouben/vban
Windows/Linux CI
project: OPM/ResInsight
Windows/Linux CI
project: iovw/Notepad--
Windows CI
project: Mudlet/Mudlet
Linux/macOS Build Mudlet
project: otland/forgottenserver
Linux/macOS/Windows Build with vcpkg
project: DPriceDev/Hestia-Game-Engine
Linux/macOS/Windows C/C++ CI
project: Element-0/ElementZero
Windows CI
project: assimp/assimp
Linux/macOS/Windows C/C++ CI
project: sony/nmos-cpp
Linux/macOS/Windows build-test
project: RaftLib/RaftLib
Linux/macOS/Windows CI
project: zealdocs/zeal
Linux/Windows Build Check
project: edubart/otclient
Linux/macOS/Windows Build with vcpkg

Developers information

Prerequisites

gulp 4 globally installed.

Build and lint

Build with tsc running:

npm run build

Launch lint by:

npm run lint

Packaging

To build, lint validate and package the extension for release purpose, run:

npm run pack

Testing

To build, pack and test:

npm run test

To run test directly:

jest

Smoke tests are implemented in this repository, which run the action on all platforms.

Rigorous tests are executed in the builds of CppBuildTasks repository that shares the same engine in the run-cmake-vcpkg-action-libs submodule.

It would be desirable to have extensive tests implemented in this repository as well.

Validation tests on various scenarios are run using the workflows of the Samples.

The software is provided as is, there is no warranty of any kind. All users are encouraged to improve the source code with fixes and new features.

License

All the content in this repository is licensed under the MIT License.

Copyright (c) 2019-2020 Luca Cappa