From fa2de9ae6be6af1e4482691e244a9085c19fae3c Mon Sep 17 00:00:00 2001 From: Daniel Ciborowski Date: Thu, 27 Apr 2023 03:36:07 -0400 Subject: [PATCH 1/3] Update action.yml --- action.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index b5717b0..2919236 100644 --- a/action.yml +++ b/action.yml @@ -54,7 +54,10 @@ inputs: Publish to PyPi Default is false default: false - + CODECOV_TOKEN: + description: | + Publish to codecov + default: '' # Advanced Settings args: description: | @@ -162,7 +165,14 @@ runs: cd "${{ inputs.root }}/${{ inputs.workdir }}" python -m flit install || python -m pip install . python -m pytest '${{ inputs.args }}' ${{ inputs.testdir }} + + flags=$(echo ${${{ inputs.args }}##* :-unittests}) shell: bash + - if: ${{ inputs.CODECOV_TOKEN != '' }} + uses: codecov/codecov-action@v3 + with: + token: ${{ env.CODECOV_TOKEN }} + flags: ${{ env.flags }} - if: ${{ inputs.pypi_publish == 'true' }} run: | From ca073c0f2bb4a60c31ab98ad9dcdd3cbce292813 Mon Sep 17 00:00:00 2001 From: Daniel Ciborowski Date: Thu, 27 Apr 2023 03:45:02 -0400 Subject: [PATCH 2/3] Update action.yml --- action.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/action.yml b/action.yml index 2919236..c1d006a 100644 --- a/action.yml +++ b/action.yml @@ -54,10 +54,6 @@ inputs: Publish to PyPi Default is false default: false - CODECOV_TOKEN: - description: | - Publish to codecov - default: '' # Advanced Settings args: description: | @@ -168,10 +164,9 @@ runs: flags=$(echo ${${{ inputs.args }}##* :-unittests}) shell: bash - - if: ${{ inputs.CODECOV_TOKEN != '' }} + - if: ${{ inputs.pytest == 'true' }} uses: codecov/codecov-action@v3 with: - token: ${{ env.CODECOV_TOKEN }} flags: ${{ env.flags }} - if: ${{ inputs.pypi_publish == 'true' }} From ffacc7d99409b8e07bf7f4a58e4587119265e66d Mon Sep 17 00:00:00 2001 From: Daniel Ciborowski Date: Sun, 30 Apr 2023 17:28:03 -0400 Subject: [PATCH 3/3] Update action.yml --- action.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index c1d006a..9868649 100644 --- a/action.yml +++ b/action.yml @@ -84,6 +84,12 @@ inputs: testdir: description: 'Test directory' default: 'tests' + coverage: + description: 'Flags for code coverage' + default: true + flags: + description: 'Flags for code coverage' + default: 'unittests' ### Flags for reviewdog ### level: @@ -161,10 +167,9 @@ runs: cd "${{ inputs.root }}/${{ inputs.workdir }}" python -m flit install || python -m pip install . python -m pytest '${{ inputs.args }}' ${{ inputs.testdir }} - - flags=$(echo ${${{ inputs.args }}##* :-unittests}) + shell: bash - - if: ${{ inputs.pytest == 'true' }} + - if: ${{ inputs.pytest == 'true' && inputs.coverage == 'true' }} uses: codecov/codecov-action@v3 with: flags: ${{ env.flags }}