Use GitHub Actions as a Dashboard Client for CMake projects.
Unlike other "cmake-action" implementations, this action does not provide custom
wrappers for the cmake
command-line, but instead builds on top of CTest's
scripting
capabilities.
| Name | Description |
|---|---|
build-name |
Describe the dashboard client platform with a short string |
change-id |
Pass arbitrary information about this build to the dashboard |
cmake-generator |
Specify a build system generator |
config-options |
Specify command-line arguments to pass to the configuration tool |
coverage-command |
Command-line tool to perform software coverage analysis |
memorycheck-command |
Command-line tool to perform dynamic analysis |
memorycheck-type |
Specify the type of memory checking to perform |
submit-url |
The URL of the dashboard server to send the submission to |
use-launchers |
Report granular build warning and error information |
| Name | Description |
|---|---|
build-errors |
Store the number of build errors detected |
build-warnings |
Store the number of build warnings detected |
memcheck-defects |
Store the number of memcheck defects found |
When not giving any other options, this action configures, builds, and tests
a CMake project. The default generator is "Unix Makefiles". A different
generator may be selected with the cmake-generator input:
jobs:
Ubuntu:
name: Ubuntu - Unix Makefiles
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chorse-dev/cmake-action@master
Ubuntu-Ninja:
name: Ubuntu - Ninja
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chorse-dev/cmake-action@master
with:
cmake-generator: Ninja
MacOS:
name: MacOS - Xcode
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: chorse-dev/cmake-action@master
with:
cmake-generator: Xcode
Windows:
name: Windows - Visual Studio 17 2022
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- uses: chorse-dev/cmake-action@master
with:
cmake-generator: Visual Studio 17 2022When using gcov, it is necessary
to pass --coverage to the compiler. It is easiest to set the flag in the
environment:
env:
CFLAGS: --coverage
CXXFLAGS: --coverage
steps:
- uses: actions/checkout@v4
- uses: chorse-dev/cmake-action@master
with:
coverage-command: gcovSimilarly, if you want to use any of clang's sanitizers, set both the compiler and necessary compiler flags as environment variables:
env:
CC: clang
CXX: clang++
CFLAGS: -fno-omit-frame-pointer -fsanitize=address
CXXFLAGS: -fno-omit-frame-pointer -fsanitize=address
steps:
- uses: actions/checkout@v4
- uses: chorse-dev/cmake-action@master
with:
memorycheck-type: AddressSanitizerResults may be sent to a dashboard server:
- uses: chorse-dev/cmake-action@master
with:
submit-url: https://chorse.dev/submit.php?project=MyProject