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 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@v2
      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@v2
      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 }}'

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.

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

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