diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 1b28ee5c..c9f9ae75 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -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 \ No newline at end of file + 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 }} \ No newline at end of file