get_it icon indicating copy to clipboard operation
get_it copied to clipboard

Could you provide a code coverage badge?

Open xuanswe opened this issue 4 years ago • 9 comments

Could you provide a code coverage badge?

Ex. https://github.com/marketplace/actions/codecov

xuanswe avatar May 15 '21 16:05 xuanswe

Unfortunately I didn't really found to look into it how to setup this correctly.

escamoteur avatar May 15 '21 16:05 escamoteur

  1. you need to register your project on codecov.io. For my case, I just allow codecov connect to my GitHub account.
  2. Just add a step like what I am doing in my package. For opensource public package, you don't need to send a token. The main thing is to make sure the lcov.info path is correct and start from the root of your repository.

This is my config: https://github.com/zenonine/navi/blob/master/.github/workflows/verify-navi.yml

- uses: codecov/codecov-action@v1
        with:
          files: ./navi/coverage/lcov.info

xuanswe avatar May 15 '21 16:05 xuanswe

that's a github action?

escamoteur avatar May 15 '21 16:05 escamoteur

codecov/codecov-action@v1 is a github action. Yes.

xuanswe avatar May 15 '21 16:05 xuanswe

I am seeing you are using it, right?

https://github.com/fluttercommunity/get_it/blob/master/.github/workflows/dart.yml

    # Code coverage can be acitivated once its ready.
    - name: Upload coverage to codecov
      uses: codecov/codecov-action@v1
      with:
        token: ${{ secrets.CODECOV_TOKEN }}

xuanswe avatar May 15 '21 16:05 xuanswe

honestly I can't remember having added that 🙄

escamoteur avatar May 15 '21 17:05 escamoteur

as this repo is part of the fluttter community organisation I first have to get the access right from them

escamoteur avatar May 15 '21 17:05 escamoteur

@lukepighetti can you add a coverage badge? you updated the CI stuff thankfully

escamoteur avatar May 08 '23 10:05 escamoteur

Could I ask why you want this? Code coverage is a pretty meaningless metric...

hughesjs avatar Feb 28 '24 23:02 hughesjs