Skip to content
Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 

Repository files navigation

CMake Action

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.

Available Inputs

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

Available Outputs

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

Example Usages

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 2022

Setting compiler flags

When 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: gcov

Similarly, 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: AddressSanitizer

Submit the results to CDash

Results may be sent to a dashboard server:

- uses: chorse-dev/cmake-action@master
  with:
    submit-url: https://chorse.dev/submit.php?project=MyProject

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors