diff --git a/.github/workflows/python-unit-test.yaml b/.github/workflows/python-unit-test.yaml index 98b85f1..8eca850 100644 --- a/.github/workflows/python-unit-test.yaml +++ b/.github/workflows/python-unit-test.yaml @@ -29,6 +29,16 @@ name: Python Checks description: The name of the PyPi package the repo will create. required: false type: string + run_coverage: + default: true + description: Boolean to determine whether coverage should be run or not. + required: false + type: boolean + test_runner: + default: 'green' + description: The runner used to run all the unit tests. + required: false + type: string test_targets: default: '' description: The directories to target for testing. @@ -73,10 +83,12 @@ jobs: run: poetry check - name: Install dependencies run: poetry install ${{ inputs.poetry_install_options }} - - name: Test with green + - name: Run unit tests run: | - poetry run green ${{ inputs.test_targets }} - poetry run coverage xml + poetry run ${{ inputs.test_runner }} ${{ inputs.test_targets }} + - name: Run coverage report + if: ${{ inputs.run_coverage }} + run: poetry run coverage xml - name: Run a test module build and install if: ${{ inputs.python_package_name != '' }} run: | diff --git a/docs/README.md b/docs/README.md index 686d2ac..16b64a0 100644 --- a/docs/README.md +++ b/docs/README.md @@ -208,8 +208,11 @@ install any [Python][5] dependencies. string in JSON format with `versions` as the key. Default: `'{ "versions": [ "3.7", "3.8", "3.9", "3.10", "3.11" ] }'` * **Note: Make sure to enclose the JSON string in single quotes!!** -* `test_targets`: A list of directories to target for testing. -[green](https://github.com/CleanCut/green) will autodetect if left blank. Default: `` +* `run_coverage`: Boolean to determine whether coverage should be run or not. Default: +`true` +* `test_runner`: The runner used to run all the unit tests. Default: `green` +* `test_targets`: A list of directories to target for testing. Runners should autodetect +if left blank. Default: `` ### terraform-docs.yaml