fluttercommunity / get_it

Get It - Simple direct Service Locator that allows to decouple the interface from a concrete implementation and to access the concrete implementation from everywhere in your App. Maintainer: @escamoteur
https://pub.dev/packages/get_it
MIT License
1.35k stars 148 forks source link

Could you provide a code coverage badge? #192

Open xuanswe opened 3 years ago

xuanswe commented 3 years ago

Could you provide a code coverage badge?

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

escamoteur commented 3 years ago

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

xuanswe commented 3 years ago
  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
escamoteur commented 3 years ago

that's a github action?

xuanswe commented 3 years ago

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

xuanswe commented 3 years ago

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 }}
escamoteur commented 3 years ago

honestly I can't remember having added that 🙄

escamoteur commented 3 years ago

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

escamoteur commented 1 year ago

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

hughesjs commented 8 months ago

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