|
49 | 49 |
|
50 | 50 | // Find the ScreenshotTests job |
51 | 51 | let screenshotTestRun = null; |
| 52 | + let workflowRunId = null; |
52 | 53 | for (const run of runs.data.workflow_runs) { |
53 | 54 | if (run.name === 'Build jMonkeyEngine') { |
| 55 | + workflowRunId = run.id; |
54 | 56 | const jobs = await github.rest.actions.listJobsForWorkflowRun({ |
55 | 57 | owner, |
56 | 58 | repo, |
|
73 | 75 | return; |
74 | 76 | } |
75 | 77 |
|
| 78 | + core.setOutput('run_url', `https://github.com/${owner}/${repo}/actions/runs/${workflowRunId}`); |
| 79 | +
|
76 | 80 | // Check if the job failed |
77 | 81 | if (screenshotTestRun.conclusion === 'failure') { |
78 | | - core.setOutput('failed', 'true'); |
| 82 | + // Now check if the changed images artifact exists |
| 83 | + const artifacts = await github.rest.actions.listWorkflowRunArtifacts({ |
| 84 | + owner, |
| 85 | + repo, |
| 86 | + run_id: workflowRunId |
| 87 | + }); |
| 88 | +
|
| 89 | + const artifact = artifacts.data.artifacts.find(a => a.name === 'screenshot-test-report'); |
| 90 | + if (artifact) { |
| 91 | + core.setOutput('failed', 'true'); |
| 92 | + core.setOutput('artifact_url', `https://github.com/${owner}/${repo}/actions/runs/${workflowRunId}/artifacts/${artifact.id}`); |
| 93 | + } else { |
| 94 | + console.log('Job failed but no changed images were generated.'); |
| 95 | + core.setOutput('failed', 'false'); |
| 96 | + } |
79 | 97 | } else { |
80 | 98 | core.setOutput('failed', 'false'); |
81 | 99 | } |
|
98 | 116 | The purpose of these tests is to ensure that changes introduced in this PR don't break visual features. They are visual unit tests. |
99 | 117 |
|
100 | 118 | 📄 **Where to find the report:** |
101 | | - - Go to the (failed run) > Summary > Artifacts > screenshot-test-report |
| 119 | + - **[Direct Download: screenshot-test-report](${{ steps.check-status.outputs.artifact_url }})** |
| 120 | + - Alternatively, go to the [failed run summary](${{ steps.check-status.outputs.run_url }}) > Artifacts > screenshot-test-report |
102 | 121 | - Download the zip and open jme3-screenshot-tests/build/reports/ScreenshotDiffReport.html |
103 | 122 |
|
104 | 123 | ⚠️ **If you didn't expect to change anything visual:** |
|
0 commit comments