Skip to content

barreiroleo/cpp-template

Repository files navigation

cpp-template

CI/CD

A multiplatform C++23 project template with Cmake & GTest support out of the box.

Table of Contents

Table of Contents
  1. Features
  2. Local development
  3. CI/CD
  4. Known Issues

Features

  • C++23
  • Multiplatform: Linux (GCC & Clang), Windows
  • Automatic releases: Triggers releases when push version tags (v0.0.1)
  • clang-format: Webkit-based style. Few lines, simple tweaks
  • clang-tidy: Strict and modern settings
  • GTest included: GTest
  • Assertion library to safer, debuggable, and clean code: cpp-assertions
  • Local Makefile for development:
    • Uses CMake + Ninja by default
    • Exports compile_commands.json
    • Sets common ASAN environment defaults
    • Enables colorful GTest output
    • Provides frequently used commands

Local development

# All-in-one (project setup, build, and test)
make all
# Project setup
make gen
# Build
make build
# Test
make test
# Cleanup
make clean
# Graph dependencies
make graph
# Format modified cpp files
make format
# Format all cpp files in repo
make format-all

CI/CD

The build job will run on every push to the master branch and on pull requests. It can also be triggered manually.

git push origin master

Releases will be generated when version tags are pushed. The release action will consider any tag that starts with 'v' as a version tag.

git tag v0.0.1
git push --tags

Known Issues

Pushing a commit and pushing tags are separate events, so releases will trigger the entire build process again, even if artifacts were generated when the commit was pushed.

About

A multiplatform C++23 project template with Cmake & GTest support out of the box.

Resources

License

Stars

Watchers

Forks

Packages

No packages published