This is a template repository to start a new C++ project.
- In GitHub, click Use this template, then click Create a new repository.
- Fill out the form for your new repository. The values shouldn't affect the template's behavior.
- Wait for GitHub to create your new repository.
- After GitHub creates your repository, run the New Project Setup workflow.
- Click the Actions tab.
- Click the New Project Setup workflow.
- Click the Run workflow combobox.
- Set Use workflow from to
Branch: main
. - Click the Run workflow button.
The New Project Setup workflow customizes your new project. The workflow performs these steps:
- Clone the repository
- Change all instances of
CppStarter
to the new repository's name - Remove the workflow file and shell script
- Remove these instructions from README.md
- Create a
Next Release
milestone - Commit and push the changes to
main
This template repository provides all the boiler plate to get started with a high quality C++ project.
The template provides a complete C++ project that builds and runs.
- CMake infrastructure to generate a build system.
- A simple unit test that builds and runs.
The template includes GitHub workflows that run right out of the box.
- Support File Quality
This workflow ensures there are no mistakes in project support files such as Markdown documentation and tool configuration files. - C++ Build
Runs debug and release builds on Ubuntu, MacOS, and Windows. - C++ Static Analysis
Runs static analysis tools on the C++ code.
I use Visual Studio Code, so this template includes settings, tasks, and extension recommendations for that IDE.
The VS Code configuration includes a set of tasks to emulate the GitHub workflows.
These can help you check the entire code base of your project before pushing.
Each task has the prefix ProjectName:
, where "ProjectName" is the name of the repo you create from the template.
The available tasks are:
ProjectName: Spell Check
- Run CSpell on all files in the repository. Spelling mistakes are captured in the Problems panel.ProjectName: Markdownlint
- Run Markdownlint on all Markdown files in the repository. Markdown mistakes are captured in the Problems panel.ProjectName: Prettier Format
- Run Prettier on all files in the repository. This doesn't report formatting errors; it reformats the files in-place.ProjectName: Pipeline
- Run all the other tasks. This is a shortcut to invoke all the other tasks with a single command.