Skip to content

Commit

Permalink
feat: init pytest workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
RaoHai committed Aug 21, 2024
1 parent 1f1108f commit 0cd673b
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,24 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install ruff
pip install pytest pytest-cov pytest-md-report
- name: Lint with Ruff
run: |
pip install ruff
ruff check --output-format=github .
- name: Test with pytest
env:
REPORT_OUTPUT: md_report.md
run: |
pip install pytest pytest-cov
pytest
echo "REPORT_FILE=${REPORT_OUTPUT}" >> "$GITHUB_ENV"
pytest -v --md-report --md-report-flavor gfm --md-report-exclude-outcomes passed skipped xpassed --md-report-output "$REPORT_OUTPUT"
- name: Render the report to the PR when tests fail
uses: marocchino/sticky-pull-request-comment@v2
with:
header: test-report
recreate: true
path: ${{ env.REPORT_FILE }}

0 comments on commit 0cd673b

Please sign in to comment.