Closed albendz closed 2 weeks ago
The Scribe team will do our best to address your contribution as soon as we can. The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)
If you're not already a member of our public Matrix community, please consider joining! We'd suggest using Element as your Matrix client, and definitely join the General and Android rooms once you're in. Also consider joining our bi-weekly Saturday dev syncs. It'd be great to have you!
I think coverage reports not added to pr https://github.com/scribe-org/Scribe-Android/actions/runs/11618292715/job/32355382459?pr=227#step:5:182
I think we might need an action to write results here.
I think coverage reports not added to pr https://github.com/scribe-org/Scribe-Android/actions/runs/11618292715/job/32355382459?pr=227#step:5:182
I think we might need an action to write results here.
From what I can tell from the logs, the action is trying to write a comment to the PR and getting access denied. I think the default token has the right permissions based on what the other workflows in this repo are doing. When you say we might need an action to write results here, what do you mean? The step I'm adding is the action to write results here though I might be missing a step.
if coverage is added to PR, it is supposed to have it as comment on current PR.
Yes I guess getting the coverage report as a comment to the PR would be nice :) I've experienced this with CodeCov in the past. Do you have a suggestion on how we could change it to add it in, @MahmoudMabrok?
I was to try on a fork and make it run, once finish I will share here.
Btw, we can merge and later we can enhance it.
Please let us know if you have some ideas on the PR comment, @MahmoudMabrok :) Really appreciate your interest in the project and wanting to help out!
Contributor checklist
./gradlew lintKotlin detekt test
command as directed in the testing section of the contributing guideDescription
This change adds the Jacoco plugin to the app/gradle.build.kts file with configuration to generate coverage reports.
Additionally, this adds a step to the unit test Github workflow to use the generated coverage XML to create a comment on PRs. This is not configured to fail the PR build. Details: https://github.com/marketplace/actions/jacoco-report
One thing I wasn't able to configure is coverage verification checks and build time.
I followed details provided in this Medium article on adding coverage to Android projects: https://medium.com/@nachare.reena8/measure-your-codes-reach-integrating-jacoco-code-coverage-in-android-apps-with-kotlin-dsl-382d577864e7
Testing
./gradlew tasks
output:Verified
./gradlew jacocoCoreDebugCodeCoverage
generates files with expected content:The github action/workflow fails to post a comment to the PR when run. I'm not sure what's causing that. I've enabled debug logging on the action/workflow but someone with repo management permissions may need to help me understand what's going wrong with the token permissions.
Related issue
196