Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add codecov integration to Github test action #459

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

camerow
Copy link
Collaborator

@camerow camerow commented Sep 18, 2024

Summary in brief

Integrate with codecov to get pretty code coverage metrics in our mono repo. This is just the initial integration commit to test the functionality. I am following their quick start docs and not adding any frills or extras, just to test functionality.

Overview of changes

  1. Add codecov integration to repository, add test-coverage Github action
  2. Use v8 reporter for code coverage, remove references to istanbul coverage reporter
  3. Break coverage reporting into components so we can see coverages changes per package via codecov.yml
  4. Use pnpm to recursively test all of the packages directory. '
  5. Currently this is being merged as informational - as a team we should discuss and commit to thresholds

Note: mobile was failing because of @/ import path aliases. I believe this must be fixed in the vitest.config.ts file but not quite sure how to do so yet. For now I simply didn't include a pnpm test:coverage command in there.

Future Enhancements

Specify levels of coverage per package type. For example apps/* should probably have a different level of acceptable coverage than most things in packages/*.

@camerow camerow linked an issue Sep 18, 2024 that may be closed by this pull request
@camerow camerow force-pushed the chore/34-add-code-coverage-tool branch 2 times, most recently from b6b17d9 to 7f1ecec Compare September 18, 2024 16:22
@camerow camerow force-pushed the chore/34-add-code-coverage-tool branch 2 times, most recently from 4e22e13 to eb71be5 Compare September 18, 2024 18:11
Copy link

codecov bot commented Sep 18, 2024

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@camerow camerow self-assigned this Sep 18, 2024
@camerow camerow force-pushed the chore/34-add-code-coverage-tool branch from 13eaa2b to a68e88b Compare September 18, 2024 21:29
@camerow camerow requested review from fbwoolf and removed request for edgarkhanzadian September 18, 2024 21:29
Copy link
Contributor

@fbwoolf fbwoolf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typically we do squash into one commit before merging.

@@ -85,5 +85,24 @@ jobs:

- run: pnpm build

- name: Run unit tests
- name: Run unit tests with code coverage
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we still need test-unit as here I think we're running the tests twice?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a good question, likely we don't, though I split them for the sake of the initial testing (at the very least) for a bit of sanity. I should probably remove the test-coverage command and just stick with unit for the ci

Copy link
Collaborator

@kyranjamie kyranjamie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to @fbwoolf's comment. As this is a small code change, it's more helpful when looking back at git history to see a single commit, and also renders nicer change logs.

Also, we can reference the issue in that commit e.g. ci: add code coverage, closes #34

@kyranjamie kyranjamie changed the title ci: add codecov integration to gitlab test action ci: add codecov integration to Github test action Sep 19, 2024
@pete-watters
Copy link
Contributor

+1 to @fbwoolf's comment. As this is a small code change, it's more helpful when looking back at git history to see a single commit, and also renders nicer change logs.

Also, we can reference the issue in that commit e.g. ci: add code coverage, closes #34

Nice work Will! To add to what Kyran said, when working an an issue from a different repo, you need to specify the repo to get the issue to link correctly.

For example this is an issue from leather-io/issues but the repo is leather-io/mono so you need to use:

git commit -a -m "fix: some message, closes leather-io/issues#324"

ci: is also perfect to use in this case but FYI when working on packages that you want to be added to the release please auto release you need to specify fix: / feat: for it to deem it worthy of creating a release

@camerow camerow force-pushed the chore/34-add-code-coverage-tool branch from a68e88b to ef36acb Compare September 19, 2024 19:01
@camerow camerow force-pushed the chore/34-add-code-coverage-tool branch from ef36acb to a60380f Compare September 19, 2024 20:50
@camerow camerow added this pull request to the merge queue Sep 19, 2024
Merged via the queue into dev with commit 17b5a3c Sep 19, 2024
10 checks passed
@camerow camerow deleted the chore/34-add-code-coverage-tool branch September 19, 2024 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add code coverage tool
5 participants