Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
441 commits
Select commit Hold shift + click to select a range
66cab68
Cleanup & Optimizations (#60)
pftg Feb 15, 2023
e76818a
Do not test first screenshot (#68)
pftg Feb 17, 2023
70c4752
Fix linter
pftg Feb 17, 2023
322e6cb
Fixes rbs signatures (#65)
pftg Feb 17, 2023
c3fa7c9
Adds truffleruby (#66)
pftg Feb 18, 2023
a9c882f
Adds cross test to compare annotations (#67)
pftg Feb 18, 2023
fbcc415
Reduce number of possible tests (#69)
pftg Feb 18, 2023
c637b6d
Adds Cucumber integration (#73)
pftg Mar 10, 2023
3541725
Allows to use tolerance for chunky png (#77)
pftg Aug 5, 2023
fdb3aeb
Update readme with retina instructions (#79)
phikes Aug 5, 2023
0a03e1f
Bump actions/checkout from 3 to 4 (#80)
dependabot[bot] Sep 4, 2023
7e8a131
Fix "unix error: File name too long" when using Vips (#81)
pnc Sep 9, 2023
5a08f09
Narrow support to upstream supported versions of Ruby and Rails.
UweKubosch Sep 13, 2023
60d6173
Handle adding new screenshots when using GIT LFS.
UweKubosch Sep 13, 2023
c4808c6
Bump version to 1.8.0 for release.
UweKubosch Sep 13, 2023
ee2771c
Allow using puma 6 with JRuby.
UweKubosch Sep 13, 2023
27c9198
Update CONTRIBUTING.md with release command.
UweKubosch Sep 13, 2023
a6fcdf4
Disable puma 6 in tests for JRuby.
UweKubosch Sep 13, 2023
b47aabd
Allow longer running test for JRuby.
UweKubosch Sep 13, 2023
52e118a
Enable puma 6 in tests for JRuby.
UweKubosch Sep 13, 2023
ac171f1
Verify that tests run after checkout. (#83)
donv Sep 14, 2023
15a1112
Use "compatible with" version selector.
UweKubosch Sep 14, 2023
bf8bb8d
Fixed case when awaiting images to load before taking the screenshot.
donv Sep 15, 2023
4f34873
Display the source line for the calling test in the screenshot differ…
donv Sep 15, 2023
37c06ea
Adjust signature of `assert_image_not_changed` to take a `caller` Str…
donv Sep 15, 2023
1fd5448
Omit the long and noisy stack trace for the test framework in the dif…
donv Sep 15, 2023
0f26bc5
Omit the long and noisy stack trace for the test framework in the dif…
donv Sep 15, 2023
6a113e2
Handle GIT LFS on shells without PIPESTATUS.
donv Sep 25, 2023
7d1d087
Cleanup code & configurations (#86)
pftg Nov 7, 2023
fe828ad
Use ceil before converting to an integer in BrowserHelpers.region_for…
asavageiv Nov 8, 2023
7a81562
Move screenshot clearing to be before error raise (#90)
TaylorBrysonRouse Nov 30, 2023
c49dd40
refact: wrap image compare constructor
pftg Dec 10, 2023
bf2ef10
refact: use build
pftg Dec 10, 2023
5290c16
refact: extracted default reporter
pftg Dec 10, 2023
16f803b
refact: detach Reporter from ImageComparer
pftg Dec 10, 2023
dec0d41
refact: replace file names with paths and other cleanups
pftg Dec 10, 2023
8545797
chore: fixes lint
pftg Dec 10, 2023
159ec4b
chore: cleanup
pftg Dec 10, 2023
c1b0161
fix: revert bad refactoring
pftg Dec 10, 2023
fd74aa1
chore: drops unused method
pftg Dec 10, 2023
a171f4a
chore: drops unused method
pftg Dec 10, 2023
16e54a1
chore: cleanups
pftg Dec 10, 2023
bbbb374
chore: makes quick equal much closer to find_difference
pftg Dec 10, 2023
e2c96ec
test: run stack frames tests on CI
pftg Dec 10, 2023
222f2fe
feat: for vips generated annotations per pixel (#94)
pftg Dec 17, 2023
a44ddf1
feat: extract format for images to use
pftg Dec 17, 2023
1442ba9
cleanups
pftg Dec 17, 2023
14e5245
cleanups
pftg Dec 17, 2023
5ab0dcd
Bump actions/upload-artifact from 3 to 4
dependabot[bot] Dec 18, 2023
67878e2
fix: honor global screenshot format setting
pftg Dec 21, 2023
73276dc
build: removes chunky_png requirements to be more flexible
pftg Dec 21, 2023
baf117d
build: updates dockerfile with 3.2 ruby
pftg Dec 21, 2023
d8a4da7
build: drops support of truffleruby
pftg Dec 10, 2023
c285e49
Correct macos ficture screenshot size
donv Jan 2, 2024
1774a5f
docs: adds details about screenshot format settings
pftg Jan 9, 2024
690af73
Bump actions/cache from 3 to 4
dependabot[bot] Jan 22, 2024
018023e
fix: prevent nomethod error for case when skip area is outside crop a…
pftg Jan 28, 2024
b8fee93
refact: optimizes to save png files (#99)
pftg Jan 28, 2024
345a224
feat: Force failure when base screenshot is missing on CircleCI (#101)
pftg Jan 28, 2024
20c82b1
Use the latest Ruby 3.3 in CI.
donv Jan 28, 2024
4cf8dcb
"OS" feels like a "higher level" path than "driver"
donv Jan 28, 2024
7f8db36
fix: avoid use minitest 5.21 until bug will be fixed
pftg Jan 29, 2024
f98a843
tests: updates for firefox/macos screenshots
pftg Jan 29, 2024
ab2daa0
Warn people about skip_area wait behavior with css selectors
asavageiv Jan 31, 2024
dd6d8af
Bump nick-fields/retry from 2 to 3
dependabot[bot] Feb 5, 2024
116a7c5
Added option `fail_on_difference`
donv Mar 5, 2024
af1ad1e
chore: adds documentation for fail_if_new option
pftg Mar 26, 2024
dba2cb4
`ArgumentError: comparison of Float with nil failed` in `Screenshoter…
pftg Apr 10, 2024
ce9a0f6
refact: use monotonic time to calculate elapsed time
pftg Apr 10, 2024
13ab6f2
fix: prevent error for cuprite (#112)
pftg Jul 12, 2024
fdb810c
feat: allows to bypass screenshot options to capybara (#111)
pftg Jul 12, 2024
a1e2a6d
build: use 3.3 as default (#113)
pftg Jul 12, 2024
aa6f17b
refact: reworks test framework integration (#116)
pftg Jul 17, 2024
08c001c
refact: drops rbs usage (#122)
pftg Jul 21, 2024
219dc24
refact: simplify readability for stable screenshot (#121)
pftg Jul 23, 2024
c564934
refact: shows deprecation message only when minitest required automat…
pftg Jul 30, 2024
f942c0f
Publish new releases by GitHub Actions (#78)
pftg Jul 30, 2024
34238c1
test: prevent ruby 3.4.0 fail
pftg Jul 30, 2024
84f0909
Include CapybaraScreenshotDiff::DSL in all RSpec system tests by defa…
asavageiv Aug 1, 2024
8fe324f
Encapsulates screenshot manager (#124)
pftg Aug 11, 2024
90f71e1
Fixes multiple problems (#132)
pftg Sep 12, 2024
31f1755
bump 1.9.1
pftg Sep 12, 2024
2c94698
chore: ignores lazy images
pftg Oct 31, 2024
caafa9d
Relax rails version constraints (#135)
fabiormoura Nov 19, 2024
d1adc5a
Update version.rb
pftg Nov 20, 2024
17c050c
fix: prevents rspec collision (#137)
pftg Dec 20, 2024
ac76bb7
build: review broken CI tests (#138)
pftg Dec 20, 2024
a5adf47
Adjust chrome test browser height
donv Dec 24, 2024
80ba12d
Cleanup stack traces
donv Dec 30, 2024
673deaf
Adjust chrome test browser height
donv Dec 30, 2024
ed8050f
Adjust chrome test browser height
donv Dec 30, 2024
1e7103f
Adjust chrome test browser height
donv Dec 30, 2024
20e8caf
Adjust chrome test browser height
donv Dec 30, 2024
a8775ff
Add testing of Ruby 3.4 and Rails 7.2 and remove testing of Ruby 3.1 …
donv Dec 30, 2024
f9c56ed
Silence warning for RUBY_GC_HEAP_INIT_SLOTS
donv Dec 30, 2024
5358f20
Add testing of Ruby 3.4 and Rails 7.2 and remove testing of Ruby 3.1 …
donv Dec 30, 2024
d241fd3
Add testing of Ruby 3.4 and Rails 7.2 and remove testing of Ruby 3.1 …
donv Dec 30, 2024
213da18
Add testing of Ruby 3.4 and Rails 7.2 and remove testing of Ruby 3.1 …
donv Dec 30, 2024
0692a37
Add testing of Ruby 3.4 and Rails 7.2 and remove testing of Ruby 3.1 …
donv Dec 30, 2024
ab8a4b6
Add testing of Ruby 3.4 and Rails 7.2 and remove testing of Ruby 3.1 …
donv Dec 30, 2024
9936a0a
More patient JRuby test + shorten test job name to see parameters in …
donv Dec 30, 2024
b0f7141
Silence CI warnings for missing assertions.
donv Dec 30, 2024
245da7e
Silence CI warnings for missing assertions.
donv Dec 30, 2024
5b78e54
Silence CI warnings for missing assertions.
donv Dec 30, 2024
863b573
Upload screenshots with diff on test failure.
donv Dec 30, 2024
d0f8e76
Update screenshots for Linux + selenium_chrome_headless
donv Dec 30, 2024
3b5691f
Use separate screenshot for index without image
donv Dec 30, 2024
67843cb
Use separate screenshot for index without image
donv Dec 30, 2024
dfc8930
Use separate screenshot for index without image
donv Dec 30, 2024
7c750c5
Use separate screenshot for index without image
donv Dec 30, 2024
77d02af
Disable animations for test
donv Dec 30, 2024
303d4e8
Disable animations for test
donv Dec 30, 2024
4718e93
Use separate directories for recorded screenshots.
donv Dec 30, 2024
5db2191
Use separate directories for recorded screenshots.
donv Dec 30, 2024
776ad39
Upload new screenshots on test success also.
donv Dec 30, 2024
a3e7358
Upload new screenshots on test success also.
donv Dec 30, 2024
95798e9
Bump version to 1.10.0 for release.
donv Dec 31, 2024
6af4755
Start testing with Rails 8.0
donv Dec 31, 2024
61102b6
Skip testing JRuby 9.x + Rails 8
donv Dec 31, 2024
a319a40
Update CONTRIBUTING.md
donv Dec 31, 2024
3de98d2
Skip internal stack frames for Minitest. Bump version to 1.10.1 for …
donv Dec 31, 2024
d42b8d5
Allow comparing images when the dimensions have chaned.
donv Dec 31, 2024
9668b10
Avoid deprecation warning with Minitest (#140)
lcreid May 8, 2025
1071154
refact: support per each test framework their assertions mechanisms (…
pftg May 8, 2025
69b09db
Bump v1.10.3
pftg May 8, 2025
9f14cc9
fix: typo
pftg May 8, 2025
7031448
fix: screeshots
pftg May 8, 2025
86717f0
remove warning
pftg May 8, 2025
2bc1344
bump v1.10.3.1
pftg May 8, 2025
74c832a
fix: tests helper when there are broken screenshots
pftg May 8, 2025
baa9f0f
refact: simplify test framework integrations (#141)
pftg May 24, 2025
6a15008
test: makes tests consistent (#142)
pftg May 24, 2025
74fc271
bump v1.11.0
pftg May 24, 2025
359b4e4
test: new ruby 3.5 (#146)
pftg Sep 13, 2025
c5ad669
build(deps): bump actions/checkout from 4 to 5 (#144)
dependabot[bot] Sep 29, 2025
1d57a61
hotfix: prevent to skip the big change
pftg Sep 29, 2025
3dbf8e9
build(deps): bump actions/upload-artifact from 4 to 6 (#150)
dependabot[bot] Jan 5, 2026
62419f7
build(deps): bump actions/cache from 4 to 5 (#149)
dependabot[bot] Jan 5, 2026
4a65fd8
Pin minitest to < 6 to fix missing minitest/mock (#154)
twill-hq[bot] Apr 11, 2026
eadc2aa
build(deps): bump actions/checkout from 5 to 6 (#148)
dependabot[bot] Apr 11, 2026
ab4fa48
build(deps): bump actions/upload-artifact from 6 to 7 (#151)
dependabot[bot] Apr 11, 2026
b49f86a
build(deps): bump nick-fields/retry from 3 to 4 (#152)
dependabot[bot] Apr 11, 2026
78bb04a
ignore claude
pftg Apr 11, 2026
d387627
build(deps): upgrade dependencies for modern environment compatibility
Apr 11, 2026
18d5564
fix: resolve Ruby 4.0 compatibility issues in CI
Apr 11, 2026
674e854
build: improve dockerignore, gitignore, and fix bin/setup for Ruby 4.0
pftg Apr 11, 2026
ed59add
build: add Lightpanda browser as experimental CDP alternative to Chrome
pftg Apr 11, 2026
de6e231
test: re-record screenshot baselines for upgraded Chrome
pftg Apr 11, 2026
8a7c981
docs: add development guide for Docker testing and screenshot recording
pftg Apr 11, 2026
0929cfa
docs: add DeepWiki badge to README
pftg Apr 11, 2026
be53abb
fix: resolve setup ordering issue with DSLStub in Ruby 4.0
pftg Apr 11, 2026
83e7acc
cleanup lint
pftg Apr 11, 2026
9383ad2
chore-usage-lightpanda-4dj
pftg Apr 11, 2026
2052d5f
refactor: consolidate duplicate color constants and improve naming
pftg Apr 11, 2026
e670b58
refactor: remove redundant VipsDriver#dimension override
pftg Apr 11, 2026
b90509b
refactor: remove duplicate ensure_files_exist! and unnecessary option…
pftg Apr 11, 2026
16a776e
fix: use FileUtils.compare_file for byte content comparison
pftg Apr 11, 2026
c2023c5
refactor: remove dead ImagePreprocessor#call method, update tests to …
pftg Apr 11, 2026
2271126
refactor: add bang to destructive Snap#cleanup_attempts!
pftg Apr 11, 2026
b689ef5
perf: cache without_tolerable_options? at construction
pftg Apr 11, 2026
41f053a
refactor: consolidate skip_area accessor to Comparison
pftg Apr 11, 2026
2906681
refactor: inline ComparisonLoader into ImageCompare
pftg Apr 11, 2026
7c3dcf7
refactor: delete CaptureStrategy layer and inline ScreenshotCoordinator
pftg Apr 11, 2026
2512ded
refactor: inline build_null_difference in DifferenceFinder
pftg Apr 11, 2026
835f45b
perf: eliminate array allocations in ChunkyPNG shift-detection
pftg Apr 11, 2026
3331012
fix: freeze options hash and widen rescue in files_identical?
pftg Apr 11, 2026
a88ea30
lint error
pftg Apr 11, 2026
b28f2eb
fix: remove duplicate require_relative in screenshot_matcher
pftg Apr 11, 2026
33604be
chore: remove unused benchmark script
pftg Apr 11, 2026
a3359dc
perf: memoize Difference#region_area_size
pftg Apr 11, 2026
1ffc36b
refactor: inline ScreenshotNamerDSL into DSL module
pftg Apr 11, 2026
715fa1b
feat: default fail_if_new to CI environment detection
pftg Apr 11, 2026
5ffec5d
feat: add Diff.configure block helper for setup
pftg Apr 11, 2026
786a0c1
docs: add Quick Setup guide, tolerance table, and CI defaults note
pftg Apr 11, 2026
5e4f8b1
fix: reset fail_if_new in test setup for CI compatibility
pftg Apr 11, 2026
9478f7f
refactor: flatten VipsUtil into VipsDriver class methods
pftg Apr 11, 2026
676aa94
refactor: merge build_null_comparison into build_null_difference
pftg Apr 11, 2026
444ac30
fix: prevent nil crash in tempfile cleanup
pftg Apr 11, 2026
50191f6
fix: handle extensionless files in reporter filename generation
pftg Apr 11, 2026
b427499
refactor: replace 0.step with loop in StableScreenshoter
pftg Apr 11, 2026
324aafa
perf: replace method(:region_for) with block in BrowserHelpers
pftg Apr 11, 2026
7845f88
refactor: unify Screenshoter constructor to accept comparison_options
pftg Apr 11, 2026
6d7e1a6
feat: add assert_no_screenshot_changes to DSL
pftg Apr 11, 2026
c078dec
refactor: replace implicit tuple protocol in ScreenshotAssertion
pftg Apr 11, 2026
d60c30f
feat: default blur_active_element and hide_caret to true
pftg Apr 11, 2026
0574de9
example
pftg Apr 11, 2026
ce01d98
feat: add perceptual color distance (dE00) support to VipsDriver
pftg Apr 12, 2026
076cbac
lint: fixs
pftg Apr 12, 2026
1364048
feat: add Diff.compare for standalone image comparison
pftg Apr 12, 2026
861183f
feat: add HTML reporter for visual diff dashboard
pftg Apr 12, 2026
a960612
fix: remove ActiveSupport dependency from fail_if_new default
pftg Apr 12, 2026
1b73136
fix: add recording instructions to missing baseline error
pftg Apr 12, 2026
9550153
fix: add failure_message and description to RSpec matcher
pftg Apr 12, 2026
61c7301
docs: add 60-second Quick Start to README top
pftg Apr 12, 2026
50eb197
docs: add configuration tiers (zero-config / flaky / advanced)
pftg Apr 12, 2026
ac6d4e0
docs: add Troubleshooting section with 5 common problems
pftg Apr 12, 2026
b97f576
docs: add Non-Rails setup, GitHub Actions integration, animation tip
pftg Apr 12, 2026
567df71
fix: remove misleading filter_image_with_median from ChunkyPNGDriver
pftg Apr 12, 2026
2fe2792
refactor: remove SVN support
pftg Apr 12, 2026
9a4309c
refactor: inline restore_git_revision into checkout_vcs
pftg Apr 12, 2026
993bcb9
feat: redesign HTML report with premium UI and visual testing
pftg Apr 12, 2026
e3b1a2e
fix: remove ActiveSupport runtime dependency (.presence → plain Ruby)
pftg Apr 12, 2026
785ff82
fix: Docker build — restore .git and fix bundle permissions
pftg Apr 12, 2026
c1a53c3
docs: Add about DEBUG to README
pftg Apr 12, 2026
ae9b76d
fix: clean up reporter diff artifacts (diff, base.diff, heatmap) on S…
pftg Apr 12, 2026
2a7ca5b
style: use unlink consistently, remove unnecessary comment
pftg Apr 12, 2026
ed5ab97
chore: prepare v1.12.0 release
pftg Apr 12, 2026
7e342d0
feat: GitHub Actions artifact integration with inline HTML report
pftg Apr 12, 2026
d63498a
docs: restructure README and add embed_images reporter option
pftg Apr 12, 2026
b4f043c
fix: VCS checkout_vcs path resolution for CI
pftg Apr 12, 2026
f74e93a
docs: clarify color comparison options — tolerance, perceptual_thresh…
pftg Apr 12, 2026
b50cae3
fix: address Sourcery AI review comments
pftg Apr 12, 2026
ec9fc4b
Make snap_diff reporter notifications safer
pftg Apr 12, 2026
5b6a9f4
Update thread safety doc for snap_diff
pftg Apr 12, 2026
2079a7b
Rename thread safety doc
pftg Apr 12, 2026
3a3e12a
Cover reporters snapshot mutation
pftg Apr 12, 2026
c831286
Fix thread safety issues found in review
pftg Apr 12, 2026
0188f6b
chore: remove dead code and fix test doubles (T5, T7, T8)
pftg Apr 12, 2026
69e5c9d
feat: disable_animations helper, lazy report path (P2.3, P3.1, P3.2)
pftg Apr 12, 2026
aa50fe4
test: extract shared driver contract tests (T1)
pftg Apr 12, 2026
331b5c3
fix: VCS stability, global state guard, bin/ci
pftg Apr 12, 2026
0ef20d0
fix: README Quick Start — commit baselines before second run
pftg Apr 12, 2026
1d64712
fix: update report path references to doc/screenshots/snap_diff_repor…
pftg Apr 12, 2026
9af132f
fix: suppress 'fatal: not a git repository' noise in test output
pftg Apr 12, 2026
e032565
docs: test fixtures README and ADR-006 cleanup (#177)
pftg Apr 12, 2026
2e5103d
fix: deduplicate glob results in snap_diff:clean rake task (#178)
pftg Apr 12, 2026
f5aa3ef
docs: updates changelog
pftg Apr 12, 2026
f9ae0cf
docs: rewrite README with value-first positioning and Web UI section
pftg Apr 12, 2026
1faadc6
fix: action report filename mismatch + README round 2 improvements
pftg Apr 12, 2026
491cf52
fix: add text language to fenced code block (MD040)
pftg Apr 12, 2026
2969b87
feat: always print summary after tests (like SimpleCov)
pftg Apr 12, 2026
ee691db
Apply suggestion from @sourcery-ai[bot]
pftg Apr 12, 2026
d7153ab
refactor: simplify at_exit hook, remove dead code
pftg Apr 12, 2026
fc8dbaa
fix: use Minitest.after_run for report summary (#182)
pftg Apr 12, 2026
18bd171
fix: skip at_exit when framework adapter handles finalization (#183)
pftg Apr 12, 2026
38504bd
docs: add Web UI screenshot to README (#184)
pftg Apr 12, 2026
9ec47a5
chore: set version to 1.11.0, improve README engagement (#185)
pftg Apr 13, 2026
36f7fd7
fix: release workflow require path + bump to v1.12.0
pftg Apr 13, 2026
6460d2c
docs: add workflow benefit line for Web UI section
pftg Apr 13, 2026
5af1d6f
fix: release workflow runs unit tests only
pftg Apr 13, 2026
7d81cd2
fix: release workflow uses same setup as test workflow
pftg Apr 13, 2026
f477350
docs: add hero screenshot at top of README
pftg Apr 13, 2026
18bb33a
docs: use annotated view for Web UI section, avoid duplicate hero image
pftg Apr 13, 2026
d915463
fix: use forked cache-apt-pkgs-action with Node 24 support
pftg Apr 13, 2026
acd6fcb
fix: increase timeout for jobs that install apt packages
pftg Apr 13, 2026
9d4f3ad
feat: add job summary with report links to CI
pftg Apr 13, 2026
4e7be3b
chore: CI workflow improvements
pftg Apr 13, 2026
4070438
refactor: ADR-006 T3+T4 — hoist setup, consolidate assertion helpers …
pftg Apr 13, 2026
7117585
ignore report
pftg Apr 13, 2026
64c5aef
chore(deps): bump softprops/action-gh-release from 2 to 3 (#187)
dependabot[bot] Apr 13, 2026
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
25 changes: 25 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.github/
.ruby-lsp/
coverage/
tmp/
# Keep .git/ — needed for gemspec git ls-files and VCS checkout in tests
.idea/
.claude/
.bundle/
vendor/
.specs/
*.gem
*.rbc
*.log

# Ignore report files
*.attempt_*.png
*.diff.png
*.base.png
*.attempt_*.webp
*.diff.webp
*.base.webp

# OS files
.DS_Store
Thumbs.db
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.gemspec diff=ruby
*.rake diff=ruby
*.rb diff=ruby
*.md diff=md
38 changes: 38 additions & 0 deletions .github/actions/setup-ruby-and-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: 'Setup Ruby and Cache'
description: 'Set up Ruby environment and cache apt packages'
inputs:
ruby-version:
description: 'Ruby version to set up'
required: true
ruby-cache-version:
description: 'Bundler cache version'
required: false
cache-apt-packages:
description: 'Whether to cache apt packages'
required: false
default: 'false'
runs:
using: 'composite'
steps:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ inputs.ruby-version }}
bundler-cache: true
cache-version: ${{ inputs.ruby-cache-version }}-v1

- name: Install and cache vips
if: ${{ inputs.cache-apt-packages == 'true' }}
uses: jetthoughts/cache-apt-pkgs-action@fix/upgrade-actions-cache-v5
with:
packages: libvips libglib2.0-0 libglib2.0-dev libwebp-dev libvips42 libpng-dev
version: tests-v2

- name: Install vips (fallback)
if: ${{ inputs.cache-apt-packages != 'true' }}
run: sudo apt-get -qq update && sudo apt-get -qq install -y libvips
shell: bash

- run: sudo sed -i 's/true/false/g' /etc/fonts/conf.d/10-yes-antialias.conf
shell: bash
113 changes: 113 additions & 0 deletions .github/actions/upload-screenshots/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
---
name: 'Upload SnapDiff screenshots'
description: 'Upload screenshot diffs, HTML report, and optionally comment on PR'
inputs:
name:
description: 'Artifact name prefix'
required: true
report-path:
description: 'Path to the HTML report directory'
default: 'doc/screenshots'
retention-days:
description: 'Number of days to retain artifacts'
default: '2'
pr-comment:
description: 'Post PR comment with report link (requires pull-requests: write)'
default: 'false'
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:
- name: Upload screenshot diffs
uses: actions/upload-artifact@v7
with:
name: ${{ inputs.name }}-diffs
retention-days: ${{ inputs.retention-days }}
path: test/fixtures/app/doc/screenshots/
if-no-files-found: ignore

- name: Upload Capybara failure screenshots
uses: actions/upload-artifact@v7
with:
name: ${{ inputs.name }}-capybara-fails
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 }}/snap_diff_report.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 }}/snap_diff_report.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 }}/

- name: Job summary
if: steps.check-report.outputs.exists == 'true'
shell: bash
run: |
cat >> "$GITHUB_STEP_SUMMARY" <<EOF
### SnapDiff Report

| Artifact | Link |
|----------|------|
| HTML report (inline) | ${{ steps.upload-report.outputs.artifact-url || 'N/A' }} |
| Full report with images | ${{ steps.upload-report-full.outputs.artifact-url || 'N/A' }} |
EOF

- name: Find existing PR comment
if: inputs.pr-comment == 'true' && github.event_name == 'pull_request'
uses: peter-evans/find-comment@v3
id: find-comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: 'Screenshot diffs'

- name: Comment PR with report link
if: inputs.pr-comment == 'true' && github.event_name == 'pull_request'
uses: peter-evans/create-or-update-comment@v5
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
edit-mode: replace
body: |
### Screenshot diffs detected

| Artifact | Link |
|----------|------|
| HTML report (inline) | ${{ steps.upload-report.outputs.artifact-url || 'N/A' }} |
| Full report with images | ${{ steps.upload-report-full.outputs.artifact-url || 'N/A' }} |
| [All artifacts](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts) | Browse all |
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
version: 2

updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
38 changes: 38 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Lint

on:
pull_request:
branches: [ master ]
paths:
- '**.rb'
- '**.yml'
- '.github/workflows/lint.yml'
- '!bin/**'

env:
RUBY_YJIT_ENABLE: 1

jobs:
lint:
name: Ruby & YAML
runs-on: ubuntu-latest
timeout-minutes: 3

steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '4.0'
bundler-cache: true

- name: Run Standard Ruby linter
run: bin/standardrb --no-fix --fail-fast

- name: Run Yaml linter
run: |
sudo apt-get install --fix-missing -qq --no-install-recommends yamllint
yamllint ./
63 changes: 63 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
name: Release

on:
workflow_dispatch:
inputs:
version:
description: "Release version (e.g., 1.12.0)"
required: true
type: string

jobs:
release:
name: Release v${{ github.event.inputs.version }}
runs-on: ubuntu-latest
timeout-minutes: 10

permissions:
id-token: write
contents: write

steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-ruby-and-dependencies
with:
ruby-version: "4.0"
cache-apt-packages: true

- name: Verify version
run: |
GEM_VERSION="${{ github.event.inputs.version }}"
CODE_VERSION=$(ruby -I lib -r capybara/screenshot/diff/version -e "puts Capybara::Screenshot::Diff::VERSION")
if [ "$GEM_VERSION" != "$CODE_VERSION" ]; then
echo "Version mismatch: input=$GEM_VERSION code=$CODE_VERSION"
exit 1
fi

- name: Test
run: bundle exec rake test:unit

- name: Create tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "v${{ github.event.inputs.version }}" -m "v${{ github.event.inputs.version }}"
git push origin "v${{ github.event.inputs.version }}"

- name: Publish to RubyGems
uses: rubygems/release-gem@v1

- name: Create GitHub Release
uses: softprops/action-gh-release@v3
with:
tag_name: "v${{ github.event.inputs.version }}"
name: "v${{ github.event.inputs.version }}"
body: |
## What's Changed

See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md#v${{ github.event.inputs.version }}) for full details.

**Upgrade Guide:** [docs/UPGRADING.md](https://github.com/${{ github.repository }}/blob/main/docs/UPGRADING.md)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading