From c2b1093171805dca3b72e3694998eff28304af69 Mon Sep 17 00:00:00 2001 From: Mateusz Hawrus <48822818+nieomylnieja@users.noreply.github.com> Date: Tue, 5 Nov 2024 14:23:34 +0100 Subject: [PATCH] chore: Update README.md (#46) ## Summary Update both README.md and DEVELOPMENT.md with the coverage and benchmarks sections. --- .github/workflows/coverage-and-benchmark.yml | 2 +- README.md | 17 ++++++++++++++- docs/DEVELOPMENT.md | 22 ++++++++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage-and-benchmark.yml b/.github/workflows/coverage-and-benchmark.yml index 440923b..b6ac02b 100644 --- a/.github/workflows/coverage-and-benchmark.yml +++ b/.github/workflows/coverage-and-benchmark.yml @@ -8,7 +8,7 @@ permissions: contents: write jobs: test: - name: Run unit tests + name: Run coverage and benchmark runs-on: ubuntu-latest steps: - name: Check out code diff --git a/README.md b/README.md index a12dd6d..15bb9fd 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ It also allows writing self-documenting validation rules through a **GO** **V**alidate **Y**ourself! -**DISCLAIMER** govy is in active development, while the core API is unlikely +**DISCLAIMER**: govy is in active development, while the core API is unlikely to change, breaking changes may be introduced with new versions until v1 is released. Checkout [roadmap](./docs/ROADMAP.md) for upcoming, planned features. @@ -39,6 +39,8 @@ planned features. 1. [Reflection](#reflection) 2. [Trivia](#trivia) 5. [Development](#development) + 1. [Tests coverage](#tests-coverage) + 2. [Benchmarks](#benchmarks) 6. [Acknowledgments](#acknowledgments) ## Getting started @@ -613,6 +615,19 @@ with them, and the idea for `govy` was born. Checkout both [contributing guidelines](./docs/CONTRIBUTING.md) and [development instructions](./docs/DEVELOPMENT.md). +### Tests coverage + +Tests coverage HTML for current `main` branch state can be inspected +[here](https://raw.githack.com/wiki/nobl9/govy/coverage.html). + +Note that `cmd` package is tested by building and running Go binaries directly. +This means there won't be any coverage for some of the core functions there. + +### Benchmarks + +Benchmarks' history is collected and can be viewed as charts over time +[here](https://nobl9.github.io/govy/dev/bench/). + ## Acknowledgments The API along with the accompanying nomenclature was heavily inspired by the diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index 367504a..f1528f4 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -74,3 +74,25 @@ Refer to this [README.md](../internal/validation/README.md) for more information Renovate is configured to automatically merge minor and patch updates. For major versions, which sadly includes GitHub Actions, manual approval is required. + +## Tests coverage + +Tests coverage reporting is automated using the following actions: +- [go-coverage-report](https://github.com/ncruces/go-coverage-report) which + is responsible for updating the coverage badge in main README.md. + It stores the coverage results in GitHub wiki and it can be easily inspected + [here](https://raw.githack.com/wiki/nobl9/govy/coverage.html). + This action is run only on `push` events to _main_ branch. +- [coverdiff](https://github.com/kskitek/coverdiff) which is executed on each + PR runs the tests coverage and posts a summary report as a comment. + It highlights positive and negative changes. + +## Benchmarks + +[github-action-benchmark](https://github.com/benchmark-action/github-action-benchmark) +is used to collect and store benchmarks' results. +It inspects PRs and if a configured threshold difference between previous +and current results is breached it will leave a comment on the affected PR. + +On top of that it publishes benchmarks' history charts onto +[GitHub Pages](https://nobl9.github.io/govy/dev/bench).