ci: improve validation

This commit is contained in:
Paul Pfeister 2025-09-20 17:43:00 -04:00
parent 97ba4e8616
commit fa05641661
No known key found for this signature in database
GPG Key ID: 70D33A96CBD7A994
2 changed files with 32 additions and 2 deletions

View File

@ -62,12 +62,38 @@ jobs:
- name: Validate modified targets
if: steps.discover-modified.outputs.changed_targets != ''
continue-on-error: true
run: |
$(poetry env activate)
pytest -q --tb no -rA -m validate_targets -n 20 --chunked-sites "${{ steps.discover-modified.outputs.changed_targets }}"
pytest -q --tb no -rA -m validate_targets -n 20 --chunked-sites "${{ steps.discover-modified.outputs.changed_targets }}" --junitxml=validation_results.xml
deactivate
- name: Announce skip if no modified targets
- name: Prepare validation summary
if: steps.discover-modified.outputs.changed_targets != ''
id: prepare-summary
run: |
$(poetry env activate)
summary=$(
python devel/summarize_site_validation.py validation_results.xml > summary.md || echo "Failed to generate summary of test results"
)
deactivate
echo "summary<<EOF" >> $GITHUB_OUTPUT
echo "$summary" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Announce validation results
if: steps.discover-modified.outputs.changed_targets != ''
uses: actions/github-script@v8
with:
script: |
github.rest.issues.createComment({
issue_number: context.payload.pull_request.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `${{ steps.prepare-summary.outputs.summary }}`
});
- name: This step shows as ran when no modifications are found
if: steps.discover-modified.outputs.changed_targets == ''
run: |
echo "No modified targets found"

View File

@ -60,5 +60,9 @@ rstr = "^3.2.2"
pytest = "^8.4.2"
pytest-xdist = "^3.8.0"
[tool.poetry.group.ci.dependencies]
defusedxml = "^0.7.1"
[tool.poetry.scripts]
sherlock = 'sherlock_project.sherlock:main'