filipdutescu/modern-cpp-template

TODO

filipdutescu opened this issue ยท 9 comments

To be implemented:

In progress:

Done:

  • Code coverage
  • CI cache and GoogleTest build Release only
  • CMake Windows export symbols and visibility preset (through CMakeGenerateExportHeader)
  • GoogleMock integration
  • VCPKG support
  • Conan support
  • Doxygen support
  • Add separate file for sources and headers ro be used, rather than use GLOB_RECURSE)
  • Move options to separate file
  • Static Analyzers (Clang-Tidy & Cppcheck)
  • Remove static only build of library

For codecoverage I would suggest that you use codecov in a Github workflow.

It supports the most languages and allows us therefore to standardize the process.

For an example (Python! Not CPP) see here:

https://github.com/Zethson/cookietemple/blob/development/cookietemple/create/templates/cli/cli_python/%7B%7Bcookiecutter.project_slug%7D%7D/.github/workflows/codecov.yml

@Zethson yep, that is the one I am currently looking at.

Being free for the most part (from what I can gather) is also a big plus for FOSS projects without funding.

Nice!

You progressed very quickly.

I will outline the steps in an internal issue tonight.

๐Ÿ‘

@Zethson cheers! Tried my best. I am still trying to figure out if clang-tidy runs on build (as it should from the CMake config) or not. Am kinda stuck with CodeCov, which for some reason does not want to read any reports.

Any idea what I might be doing wrong?

Do you get a coverage.xml file or something of the sort?

This is how it works for our Python projects.

    - name: Generate coverage report
      run: |
        pip install -r requirements_dev.txt -r requirements.txt
        pip install pytest-cov
        pytest tests/ --cov-config=.coveragerc --cov=cookietemple/ --cov-report=xml
    - name: Upload coverage to Codecov
      uses: codecov/codecov-action@v1
      with:
        #TODO COOKIETEMPLE: Remove this when Cookietemple goes public!
        token: ${{ secrets.CODECOV_TOKEN }}
        file: ./coverage.xml
        flags: unittests
        name: codecov-umbrella
        fail_ci_if_error: true

In your workflow I cannot see anything that produces a coverage report. You're trying to upload one, but it does not exist I guess?

Am I assessing your issue correctly?

@Zethson I have just looked at some more repos using CodeCov and CMake and I think that what you assessed is correct. I am not setting up the proper flags to generate coverage, from what I can tell. I will run some more tests, hopefully it shall be fixed. Thanks!

Edit: That fixed it. Will now close issue.

Opened issue at cookietemple. Looking forward to working on including this template into cookietemple with you!

@Zethson, thanks for the issue! The pleasure is mine!

In progress

Done

  • Update README to mention ALL needed name changes (i.e. no mention of CI needing manual intervention)
  • Cookiecutter version fix headers only build
  • Cookiecutter version (ensure README is up to date)
  • Create uppercase and lowercase alternative names for version header and include folder name
  • Automatic version header generation
  • Fix workflow CMake parameters
  • Fix spelling for issue templates
  • Install CI
  • License unde Unilicense again