-
Notifications
You must be signed in to change notification settings - Fork 5
34 lines (33 loc) · 1.01 KB
/
pr-run-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: Test PRs
on:
pull_request:
jobs:
run-tests:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Install poetry
uses: abatilo/actions-poetry@v2
- name: Install dependencies
run: poetry install --with tests
- name: Run tests
env:
REPORT_OUTPUT: md_report.md
shell: bash
run: |
echo "REPORT_FILE=${REPORT_OUTPUT}" >> "$GITHUB_ENV"
poetry run pytest -v --md-report --md-report-flavor gfm --md-report-color never --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
if: failure()
with:
header: test-report
recreate: true
path: ${{ env.REPORT_FILE }}