Skip to content

Commit fa05641

Browse files
committed
ci: improve validation
1 parent 97ba4e8 commit fa05641

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

.github/workflows/validate_modified_targets.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,38 @@ jobs:
6262
6363
- name: Validate modified targets
6464
if: steps.discover-modified.outputs.changed_targets != ''
65+
continue-on-error: true
6566
run: |
6667
$(poetry env activate)
67-
pytest -q --tb no -rA -m validate_targets -n 20 --chunked-sites "${{ steps.discover-modified.outputs.changed_targets }}"
68+
pytest -q --tb no -rA -m validate_targets -n 20 --chunked-sites "${{ steps.discover-modified.outputs.changed_targets }}" --junitxml=validation_results.xml
6869
deactivate
6970
70-
- name: Announce skip if no modified targets
71+
- name: Prepare validation summary
72+
if: steps.discover-modified.outputs.changed_targets != ''
73+
id: prepare-summary
74+
run: |
75+
$(poetry env activate)
76+
summary=$(
77+
python devel/summarize_site_validation.py validation_results.xml > summary.md || echo "Failed to generate summary of test results"
78+
)
79+
deactivate
80+
echo "summary<<EOF" >> $GITHUB_OUTPUT
81+
echo "$summary" >> $GITHUB_OUTPUT
82+
echo "EOF" >> $GITHUB_OUTPUT
83+
84+
- name: Announce validation results
85+
if: steps.discover-modified.outputs.changed_targets != ''
86+
uses: actions/github-script@v8
87+
with:
88+
script: |
89+
github.rest.issues.createComment({
90+
issue_number: context.payload.pull_request.number,
91+
owner: context.repo.owner,
92+
repo: context.repo.repo,
93+
body: `${{ steps.prepare-summary.outputs.summary }}`
94+
});
95+
96+
- name: This step shows as ran when no modifications are found
7197
if: steps.discover-modified.outputs.changed_targets == ''
7298
run: |
7399
echo "No modified targets found"

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,9 @@ rstr = "^3.2.2"
6060
pytest = "^8.4.2"
6161
pytest-xdist = "^3.8.0"
6262

63+
64+
[tool.poetry.group.ci.dependencies]
65+
defusedxml = "^0.7.1"
66+
6367
[tool.poetry.scripts]
6468
sherlock = 'sherlock_project.sherlock:main'

0 commit comments

Comments
 (0)