Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions .github/workflows/screenshot-test-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ jobs:

// Find the ScreenshotTests job
let screenshotTestRun = null;
let workflowRunId = null;
for (const run of runs.data.workflow_runs) {
if (run.name === 'Build jMonkeyEngine') {
workflowRunId = run.id;
const jobs = await github.rest.actions.listJobsForWorkflowRun({
owner,
repo,
Expand All @@ -73,9 +75,25 @@ jobs:
return;
}

core.setOutput('run_url', `https://github.com/${owner}/${repo}/actions/runs/${workflowRunId}`);

// Check if the job failed
if (screenshotTestRun.conclusion === 'failure') {
core.setOutput('failed', 'true');
// Now check if the changed images artifact exists
const artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner,
repo,
run_id: workflowRunId
});

const artifact = artifacts.data.artifacts.find(a => a.name === 'screenshot-test-report');
if (artifact) {
core.setOutput('failed', 'true');
core.setOutput('artifact_url', `https://github.com/${owner}/${repo}/actions/runs/${workflowRunId}/artifacts/${artifact.id}`);
} else {
console.log('Job failed but no changed images were generated.');
core.setOutput('failed', 'false');
}
} else {
core.setOutput('failed', 'false');
}
Expand All @@ -98,7 +116,8 @@ jobs:
The purpose of these tests is to ensure that changes introduced in this PR don't break visual features. They are visual unit tests.

📄 **Where to find the report:**
- Go to the (failed run) > Summary > Artifacts > screenshot-test-report
- **[Direct Download: screenshot-test-report](${{ steps.check-status.outputs.artifact_url }})**
- Alternatively, go to the [failed run summary](${{ steps.check-status.outputs.run_url }}) > Artifacts > screenshot-test-report
- Download the zip and open jme3-screenshot-tests/build/reports/ScreenshotDiffReport.html

⚠️ **If you didn't expect to change anything visual:**
Expand Down
Loading