-
Notifications
You must be signed in to change notification settings - Fork 16
feat: GitHub Actions artifact integration with inline HTML report #171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,72 @@ | ||
| --- | ||
| name: 'Upload screenshots for debug' | ||
| description: 'To reproduce the issue locally, download the screenshots from the failed test' | ||
| name: 'Upload SnapDiff screenshots' | ||
| description: 'Upload screenshot diffs and HTML report as CI artifacts' | ||
| inputs: | ||
| name: | ||
| description: 'Customize the name of the artifact' | ||
| description: 'Artifact name prefix' | ||
| required: true | ||
| report-path: | ||
| description: 'Path to the HTML report directory' | ||
| default: 'tmp/snap_diff' | ||
| retention-days: | ||
| description: 'Number of days to retain artifacts' | ||
| default: '2' | ||
| outputs: | ||
| report-url: | ||
| description: 'Direct URL to the inline HTML report artifact' | ||
| value: ${{ steps.upload-report.outputs.artifact-url }} | ||
| report-full-url: | ||
| description: 'Direct URL to the full report artifact (with images)' | ||
| value: ${{ steps.upload-report-full.outputs.artifact-url }} | ||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - uses: actions/upload-artifact@v6 | ||
| - name: Upload screenshot diffs | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: ${{ inputs.name }}-diffs | ||
| retention-days: 1 | ||
| path: | | ||
| test/fixtures/app/doc/screenshots/ | ||
| retention-days: ${{ inputs.retention-days }} | ||
| path: test/fixtures/app/doc/screenshots/ | ||
| if-no-files-found: ignore | ||
|
|
||
| - uses: actions/upload-artifact@v6 | ||
| - name: Upload Capybara failure screenshots | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: ${{ inputs.name }}-capybara-fails | ||
| retention-days: 1 | ||
| path: | | ||
| tmp/capybara/screenshots-diffs/ | ||
| retention-days: ${{ inputs.retention-days }} | ||
| path: tmp/capybara/screenshots-diffs/ | ||
| if-no-files-found: ignore | ||
|
|
||
| - name: Check for HTML report | ||
| id: check-report | ||
| shell: bash | ||
| run: | | ||
| if [ -f "${{ inputs.report-path }}/index.html" ]; then | ||
| echo "exists=true" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "exists=false" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - name: Prepare HTML report for inline preview | ||
| if: steps.check-report.outputs.exists == 'true' | ||
| shell: bash | ||
| run: cp "${{ inputs.report-path }}/index.html" "${{ inputs.report-path }}/${{ inputs.name }}-snap_diff-report.html" | ||
|
|
||
| - name: Upload HTML report (inline preview) | ||
| id: upload-report | ||
| if: steps.check-report.outputs.exists == 'true' | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: ${{ inputs.name }}-snap_diff-report | ||
| retention-days: ${{ inputs.retention-days }} | ||
| path: ${{ inputs.report-path }}/${{ inputs.name }}-snap_diff-report.html | ||
| archive: false | ||
|
|
||
| - name: Upload HTML report with images (full download) | ||
| id: upload-report-full | ||
| if: steps.check-report.outputs.exists == 'true' | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: ${{ inputs.name }}-report-full | ||
| retention-days: ${{ inputs.retention-days }} | ||
| path: ${{ inputs.report-path }}/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,8 @@ | |
| *.base.webp | ||
| .ruby-version | ||
| .ai/ | ||
| .qwen/ | ||
| .claude/ | ||
| .specs/ | ||
| .emdash.json | ||
| CLAUDE.md | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.