GitHub Action
run-cmake
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.
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.
View the workflows based on the run-cmake and run-vcpkg actions.
CMakeLists.txt samples | |
---|---|
Linux/macOS/Windows, hosted runner, basic | |
Linux/macOS/Windows, hosted runner, advanced | |
Linux/macOS/Windows, hosted runner, with cache and vcpkg as submodule |
CMakeSettings.json samples | |
---|---|
Linux/macOS/Windows, hosted runner, with cache and vcpkg as submodule |
project: CppOpenGLWebAssemblyCMake | |
---|---|
WASM, Linux, macOS |
project: quiniouben/vban | |
---|---|
Windows, Linux |
project: OPM/ResInsight | |
---|---|
Windows, Linux |
project: iovw/Notepad-- | |
---|---|
Windows |
gulp 4 globally installed.
Build with tsc
running:
npm run build
Launch lint
by:
npm run lint
To build, lint validate and package the extension for release purpose, run:
npm run pack
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.
All the content in this repository is licensed under the MIT License.
Copyright (c) 2019-2020 Luca Cappa