filipdutescu / modern-cpp-template

A template for modern C++ projects using CMake, Clang-Format, CI, unit testing and more, with support for downstream inclusion.
The Unlicense
1.69k stars 214 forks source link

TODO #1

Closed filipdutescu closed 4 years ago

filipdutescu commented 4 years ago

To be implemented:

In progress:

Done:

Zethson commented 4 years ago

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

filipdutescu commented 4 years ago

@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.

Zethson commented 4 years ago

Nice!

You progressed very quickly.

I will outline the steps in an internal issue tonight.

:+1:

filipdutescu commented 4 years ago

@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?

Zethson commented 4 years ago

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?

filipdutescu commented 4 years ago

@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.

Zethson commented 4 years ago

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

filipdutescu commented 4 years ago

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

filipdutescu commented 4 years ago

In progress

Done