Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arduino/cpp-test-action
A GitHub Actions action for testing C/C++ projects
https://github.com/arduino/cpp-test-action
c c-plus-plus ci cmake continuous-integration coverage cpp github-actions unit-testing
Last synced: 3 months ago
JSON representation
A GitHub Actions action for testing C/C++ projects
- Host: GitHub
- URL: https://github.com/arduino/cpp-test-action
- Owner: arduino
- License: other
- Created: 2020-10-09T06:43:08.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-09-03T22:11:00.000Z (4 months ago)
- Last Synced: 2024-09-29T08:36:33.437Z (3 months ago)
- Topics: c, c-plus-plus, ci, cmake, continuous-integration, coverage, cpp, github-actions, unit-testing
- Homepage:
- Size: 59.6 KB
- Stars: 15
- Watchers: 8
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `arduino/cpp-test-action`
[![Validate](https://github.com/arduino/cpp-test-action/workflows/Validate%20action.yml/badge.svg)](https://github.com/arduino/cpp-test-action/actions?workflow=Validate+action.yml)
[![Spell Check](https://github.com/arduino/cpp-test-action/workflows/Spell%20Check/badge.svg)](https://github.com/arduino/cpp-test-action/actions?workflow=Spell+Check)A [GitHub Actions](https://github.com/features/actions) action for testing C/C++ projects:
- Use [CMake](https://cmake.org/) to build tests
- Use [Valgrind](https://valgrind.org/) to check for memory leaks
- Use [LCOV](https://github.com/linux-test-project/lcov)/[GCOV](https://gcc.gnu.org/onlinedocs/gcc/Gcov.html) to generate code coverage data and display a report in the log## Inputs
### `source-path`
Path containing the `CMakeLists.txt` for the tests.
**Default**: `extras/test`
### `build-path`
The top-level directory for build output.
**Default**: `extras/test/build`
### `runtime-paths`
YAML format list of paths to runtime binaries generated by building the tests.
**Default**: `"- extras/test/build/bin/unit-test-binary"`
### `coverage-exclude-paths`
[YAML](https://en.wikipedia.org/wiki/YAML) format list of paths to remove from coverage data.
**Default**:
```yaml
- '*/extras/test/*'
- '/usr/*'
- '*/src/lib/*'
```### `coverage-data-path`
Path to save the coverage data file to.
**Default**: `extras/test/build/coverage.info`
## Example usage
```yaml
on: [pull_request, push]
jobs:
test:
runs-on: ubuntu-latestenv:
COVERAGE_DATA_PATH: extras/coverage-data/coverage.infosteps:
- uses: actions/checkout@v2- uses: arduino/cpp-test-action@v1
with:
coverage-data-path: ${{ env.COVERAGE_DATA_PATH }}# Optional: upload coverage report to codecov.io
- uses: codecov/codecov-action@v1
with:
file: ${{ env.COVERAGE_DATA_PATH }}
```