Skip to content

Commit

Permalink
ci(test): add verbose option to reusable test workflow
Browse files Browse the repository at this point in the history
Signed-off-by: David Hart <[email protected]>
  • Loading branch information
dbhart authored Oct 22, 2024
1 parent b177de7 commit 0e0fd5c
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/pytest-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
os:
required: true
type: string
verbose:
default: false
required: false
type: boolean
secrets:
coverage_token:
required: false
Expand Down Expand Up @@ -53,12 +57,27 @@ jobs:
run: python3 -m pip install .[formats,examples,tests]

- name: Test with pytest
if: ${{ !inputs.verbose }}
run: |
python3 -m pytest --nbmake --disable-warnings --cov=sansmic --cov=tests --no-header --color=auto examples/ tests/
- name: Test with pytest (non-windows verbose)
if: ${{ inputs.verbose && inputs.os != "windows-latest" }}
run: |
echo '### Run tests' >> $GITHUB_STEP_SUMMARY
echo '```bash' >> $GITHUB_STEP_SUMMARY
python3 -m pytest --nbmake --no-cov-on-fail --disable-warnings --cov=sansmic --cov=tests --no-header --color=auto examples/ tests/ | tee -a $GITHUB_STEP_SUMMARY
python3 -m pytest --nbmake --disable-warnings --cov=sansmic --cov=tests --no-header --color=auto examples/ tests/ | tee -a $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
- name: Test with pytest (windows verbose)
if: ${{ inputs.verbose && inputs.os == "windows-latest" }}
shell: powershell
run: |
echo '### Run tests' >> $Env:GITHUB_STEP_SUMMARY
echo '```bash' >> $Env:GITHUB_STEP_SUMMARY
python3 -m pytest --nbmake --disable-warnings --cov=sansmic --cov=tests --no-header --color=auto examples/ tests/ >> $Env:GITHUB_STEP_SUMMARY
echo '```' >> $Env:GITHUB_STEP_SUMMARY
- name: Upload coverage reports to Codecov
if: success() || failure()
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
Expand Down

0 comments on commit 0e0fd5c

Please sign in to comment.