diff --git a/.github/workflows/continuous-integration.yml.tpl b/.github/workflows/continuous-integration.yml.tpl index e787dbb..5fbc455 100644 --- a/.github/workflows/continuous-integration.yml.tpl +++ b/.github/workflows/continuous-integration.yml.tpl @@ -1,5 +1,8 @@ name: "Continuous integration" +# Code coverage is automatically enabled when a `.glpi-coverage.json` file +# is present at the root of the plugin directory. + on: push: branches: @@ -33,3 +36,9 @@ jobs: glpi-version: "${{ matrix.glpi-version }}" php-version: "${{ matrix.php-version }}" db-image: "${{ matrix.db-image }}" + + coverage-report: + needs: "ci" + uses: "glpi-project/plugin-ci-workflows/.github/workflows/coverage-report.yml@v1" + with: + plugin-key: "{LNAME}" diff --git a/.glpi-coverage.json b/.glpi-coverage.json new file mode 100644 index 0000000..010732b --- /dev/null +++ b/.glpi-coverage.json @@ -0,0 +1,3 @@ +{ + "enabled": false +} diff --git a/README.md b/README.md index 47f13e4..8662b32 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,13 @@ You can also provide a destination path (ie. if your `empty` directory is not in * `{UNAME}` will be replaced by the uppercased name, * `{YEAR}` will be replaced by the current year. +## Enabling Code coverage +By default, code coverage is disabled. + +You can enable it by updating the `.glpi-coverage.json`. + +Configuration defaults and explanations are available [here](https://github.com/glpi-project/plugin-ci-workflows#code-coverage). + ## Updating Your Plugin To import the changes made to the _pluginsGLPI empty_ template into your project,