๐งช cpp plugin
Overview
The cpp plugin runs C or C++ build commands from a microCI step. It is useful when you want a lightweight, explicit pipeline that compiles sources directly with GCC or Clang, or delegates to a build system such as make.
Features
-
Direct compiler execution
Rungcc,g++,clang-22, orclang++-22commands exactly as you would on a shell. This is ideal for small projects, quick checks, and reproducible build steps. -
Build-system integration
Use the same step to callmakeor other build tools when the project already has a build recipe. This keeps the pipeline simple while still supporting larger codebases. -
Portable pipeline step
The build logic lives in.microCI.yml, so the same step can be executed locally or in CI with the same behavior.
Setup & Configuration
- Create a step in
.microCI.yml. - Set
plugin.nametocpp. - Add the shell commands you want to run under
plugin.bash. - Make sure the execution environment contains the compiler and tools you need (
gcc,g++,clang-22,clang++-22,make, etc.).
Configuration parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
steps[] |
array | yes | Pipeline steps. |
steps[].name |
string | yes | Display name for the step. |
steps[].plugin.name |
string | yes | Must be cpp. |
steps[].plugin.bash |
string | yes | Shell script executed by the step. |
steps[].description |
string | no | Human-readable description of the step. |
Example
steps:
- name: "Build static version of microCI"
description: "Description of this step"
plugin:
name: cpp
bash: |
# Use GCC compiler directly
gcc prog.c -o prog_c
g++ prog.cpp -o prog_cpp
# Test
./prog_c
./prog_cpp
# Or build systems
make clean
# Use Clang compiler directly
clang-22 prog.c -o prog_c
clang++-22 prog.cpp -o prog_cpp
./prog_c
./prog_cpp
make clean
Notes
- Use
gccfor C sources andg++for C++ sources. - Use
clang-22andclang++-22if you want to validate against Clang too. - Keep the step focused: compile, test, or package in one clear action.
- For a full project build, combine
cppwith your preferred build system insideplugin.bash.