From d68da7a56e172f586942c0ccdaea0824cf3e1508 Mon Sep 17 00:00:00 2001 From: Alejandro Santiago Date: Thu, 16 Mar 2023 22:27:42 +0000 Subject: [PATCH 1/3] docs: updated README and FAQs --- README.md | 41 ++++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index d6e35a1..ae21d21 100644 --- a/README.md +++ b/README.md @@ -16,18 +16,18 @@ A GitHub Action which helps enforce a minimum code coverage threshold. Very Good Coverage accepts the following configuration inputs: -| Input name | Description | Default value | Optional | -| ------------ | ----------------------------------------------------------------------------------------------------------------------------- | ------------------------ | -------- | -| path | The path to the lcov.info file. | `"./coverage/lcov.info"` | ✅ | -| min_coverage | The minimum coverage percentage allowed. | `100` | ✅ | -| exclude | List of paths to exclude from the coverage report, separated by an empty space. Supports [globs]() to describe file patterns. | `""` | ✅ | +| Input name | Description | Default value | Optional | +| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- | -------- | +| path | The absolute path to the lcov.info file. | `"/coverage/lcov.info"` | ✅ | +| min_coverage | The minimum coverage percentage allowed. | `100` | ✅ | +| exclude | List of paths to exclude from the coverage report, separated by an empty space. Supports [globs]() to describe file patterns. | `""` | ✅ | ## Example usage ```yaml uses: VeryGoodOpenSource/very_good_coverage@v2 with: - path: './coverage/lcov.info' + path: '/coverage/lcov.info' min_coverage: 95 exclude: '**/*_observer.dart **/change.dart' ``` @@ -50,17 +50,40 @@ If your generated lcov file is empty this might be because you have no test file If you wish to always bypass these warnings, we recommend using a conditional statement in your workflow to avoid running the Very Good Coverage action when the lcov file is empty or non-existent. -For example, if your non-existent or empty coverage file is meant to be located at `./coverage/lcov.info` you may do: +For example, if your non-existent or empty coverage file is meant to be located at `/coverage/lcov.info` you may do: ```yaml - name: Check for existing and non-empty coverage file id: test_coverage_file - run: if [ -s "./coverage/lcov.info" ]; then echo "result=true" >> $GITHUB_OUTPUT ; else echo "result=false" >> $GITHUB_OUTPUT; fi + run: if [ -s "/coverage/lcov.info" ]; then echo "result=true" >> $GITHUB_OUTPUT ; else echo "result=false" >> $GITHUB_OUTPUT; fi - name: Very Good Coverage if: steps.test_coverage_file.outputs.result == 'true' uses: VeryGoodOpenSource/very_good_coverage@v2 with: - path: './coverage/lcov.info' + path: '/coverage/lcov.info' +``` + +#### Why is my input path not relative to the specified `working-directory`? + +[Relevant issue](https://github.com/VeryGoodOpenSource/very_good_coverage/issues/35) + +The input path must be absolute. The specified working directory is ignored by the input path. This is because it is [not possible](https://github.com/actions/runner/issues/467) to access the working directory from an action. + +For example, if your working directory is `my_project` and your file is at `my_project/coverage/lcov.info` you must do: + +```yaml +jobs: + build: + defaults: + run: + working-directory: my_project/ + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Very Good Coverage + uses: VeryGoodOpenSource/very_good_coverage@v2 + with: + path: my_project/coverage/lcov.info ``` [ci_badge]: https://github.com/VeryGoodOpenSource/very_good_coverage/workflows/ci/badge.svg From 1a9d55c384485cc39ae98539f1e59d865a0f4cc3 Mon Sep 17 00:00:00 2001 From: Alejandro Santiago Date: Thu, 16 Mar 2023 22:37:56 +0000 Subject: [PATCH 2/3] docs: added / --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ae21d21..d08202a 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ For example, if your non-existent or empty coverage file is meant to be located The input path must be absolute. The specified working directory is ignored by the input path. This is because it is [not possible](https://github.com/actions/runner/issues/467) to access the working directory from an action. -For example, if your working directory is `my_project` and your file is at `my_project/coverage/lcov.info` you must do: +For example, if your working directory is `my_project` and your file is at `/my_project/coverage/lcov.info` you must do: ```yaml jobs: @@ -83,7 +83,7 @@ jobs: - name: Very Good Coverage uses: VeryGoodOpenSource/very_good_coverage@v2 with: - path: my_project/coverage/lcov.info + path: /my_project/coverage/lcov.info ``` [ci_badge]: https://github.com/VeryGoodOpenSource/very_good_coverage/workflows/ci/badge.svg From bf0581b6450ec1f374bbb6a4d46e5851e6e1e897 Mon Sep 17 00:00:00 2001 From: Alejandro Santiago Date: Fri, 17 Mar 2023 13:01:25 +0000 Subject: [PATCH 3/3] docs: included comprehensive line --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d08202a..30ec104 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ For example, if your non-existent or empty coverage file is meant to be located [Relevant issue](https://github.com/VeryGoodOpenSource/very_good_coverage/issues/35) -The input path must be absolute. The specified working directory is ignored by the input path. This is because it is [not possible](https://github.com/actions/runner/issues/467) to access the working directory from an action. +The input path must be absolute. The specified working directory is ignored by the input path. This is because it is [not possible](https://github.com/actions/runner/issues/467) to access the working directory from an action. In other words, Very Good Coverage always runs from the root of your repository. For example, if your working directory is `my_project` and your file is at `/my_project/coverage/lcov.info` you must do: