Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
327 commits
Select commit Hold shift + click to select a range
47e3f01
* Do not use ~ on save images + use committed/latest tag
Oct 29, 2019
d8396e9
Prefer formatting without the extra concept of naming each marker
UweKubosch Oct 29, 2019
c3a761e
Merge pull request #11 from hackhowtofaq/master
donv Oct 29, 2019
0f2881a
Adjust file names for tests
UweKubosch Oct 29, 2019
c9eca17
Test newest TruffleRuby
UweKubosch Oct 29, 2019
51d3426
Allow truffleruby to fail
UweKubosch Oct 29, 2019
0155e1e
Test latest stable release of each supported Ruby
UweKubosch Oct 29, 2019
e0637a7
Require Ruby 2.4+
UweKubosch Oct 29, 2019
c0eef9f
Require Ruby 2.4+
UweKubosch Oct 29, 2019
2126473
Remove old patches
UweKubosch Nov 4, 2019
d66ab28
Added guide to setting the `screenshot_section` and/or `screenshot_gr…
UweKubosch Apr 12, 2020
5eedaa8
Added line about overriding `screenshot_section` and/or `screenshot_g…
UweKubosch Apr 12, 2020
be919e6
Drop support for Ruby 2.4 and start testing with Ruby 2.7
UweKubosch Apr 12, 2020
58cf16d
Use "jobs" instead of "matrix" to avoid warnings
UweKubosch Apr 12, 2020
66ab187
Use rubocop 0.81+
UweKubosch Apr 12, 2020
15f8387
Move development and test gems into Gemfile since the wrong versions …
UweKubosch Apr 12, 2020
c31833c
Remove duplicate definition of test gems
UweKubosch Apr 12, 2020
b4c330b
Try using `ruby-install` instead of `rvm`
UweKubosch Apr 12, 2020
5ac1e97
Try using newest BigDecimal on JRuby
UweKubosch Apr 12, 2020
53079d1
Try using the default BigDecimal on JRuby
UweKubosch Apr 12, 2020
f4c0630
Try using the default BigDecimal on JRuby
UweKubosch Apr 12, 2020
20950b0
Revert to using "rvm" since "ruby" is an alias
UweKubosch Apr 12, 2020
be101f5
Use openjdk14
UweKubosch Apr 12, 2020
6f58a79
Prevents browser leaking on taking screenshots
pftg Jun 1, 2020
bd4a93e
Merge pull request #14 from jetthoughts/bug-browser-instances-leaks
donv Sep 7, 2020
f0aea55
Introduce VIPs adapter for faster image processing
pftg Jul 14, 2020
b8b7863
Merge pull request #16 from jetthoughts/introduce-new-adapters
donv Sep 7, 2020
3379170
Skip `nil` values for `skip_area`
donv Sep 10, 2020
1feb822
Only load the required drivers
donv Sep 11, 2020
fcebb62
Need a mysterious "dot"
donv Sep 11, 2020
9c4f9d6
Fix wonky require_relative
donv Sep 11, 2020
89b033a
Handles auto driver option
pftg Sep 17, 2020
f3a993d
Merge pull request #18 from jetthoughts/adds-auto-driver-option
donv Sep 26, 2020
c4fbc35
Allow probing for vips without raising
UweKubosch Sep 26, 2020
f1b061d
Simplify rubocop config
UweKubosch Sep 26, 2020
cefc14f
Blur cursor when not stabilizing screenshot
UweKubosch Sep 26, 2020
b3a555b
Skip minitest-reporters since it is not needed anymore
UweKubosch Sep 26, 2020
f5c9882
Support checking out old images via LFS
zofrex Sep 29, 2020
bb91099
Adds tests when ruby-vips raises load error
pftg Oct 11, 2020
afc0700
Remove dependency on JQuery for hiding the caret
zofrex Sep 29, 2020
0a53e3f
Remove broken, duplicated error message
zofrex Oct 13, 2020
2734eff
Merge pull request #25 from zofrex/fix-unstable-error-message
donv Oct 13, 2020
f7282f8
Merge pull request #23 from jetthoughts/21-vips-error-on-missed-vipsi…
donv Oct 15, 2020
f8342ee
Merge pull request #22 from zofrex/lfs-support
donv Oct 15, 2020
4e860ac
Only hide caret once
zofrex Oct 16, 2020
d8d55af
Merge pull request #24 from zofrex/no-jquery
donv Nov 23, 2020
b0ff9c4
Replaces Rubocop with Standard
pftg Oct 11, 2020
55c1a06
Apply standard linter fixes
pftg Oct 11, 2020
7f79406
Merge pull request #20 from jetthoughts/integrate-standard
donv Nov 23, 2020
0198cbf
Migrates from Travis to Github Actions
pftg Dec 3, 2020
45cf608
Merge pull request #29 from jetthoughts/test-travis-config
donv Dec 3, 2020
d457c76
Adds browser tests to verify integrations
pftg Nov 23, 2020
20cee9c
Adds git attributes for better diff
pftg Dec 4, 2020
88a6b28
Merge pull request #30 from jetthoughts/adds-gitattributes
donv Dec 4, 2020
6b738b2
Merge pull request #28 from jetthoughts/27-adds-browser-integration-t…
donv Dec 4, 2020
4df1ad8
Extracts compare strategy from drivers to ImageCompare
pftg Dec 5, 2020
85b8e98
Allow to use selected driver for handling retina screens
pftg Dec 5, 2020
bd517e5
Drop coverage support for JRuby in order to reduce complexity
pftg Dec 5, 2020
077ccf8
Merge pull request #31 from jetthoughts/cleanup-drivers-duplications
donv Dec 5, 2020
5126ef2
Moves tests and development gems from gemspec
pftg Dec 5, 2020
705c336
Adds cuprite driver
pftg Dec 5, 2020
0c54478
Exteneds matrix with capybara and screenshot drivers
pftg Dec 5, 2020
2d58516
Merge pull request #32 from jetthoughts/extend-matrix-with-different-…
donv Dec 6, 2020
efc840e
Adds 6 1 rails to test (#34)
pftg Dec 18, 2020
f192b50
Draw skip_areas + some fixes after trying to use master on a project …
donv Dec 18, 2020
c958763
Bump version to 1.4.0
UweKubosch Dec 18, 2020
d1c9e2c
Fix reverted file names of annotated images
UweKubosch Dec 23, 2020
ac8f816
Allow testing without installing VIPS
donv Dec 29, 2020
79580ba
Run tests against PRs vs master
donv Dec 29, 2020
ce7aff6
Adds ruby 3.0 support (#37)
pftg Dec 30, 2020
e8b60b8
Bump to version 1.5.0 for Ruby 3.0 release
donv Dec 30, 2020
27d0652
Fixed ChunkyPNG::OutOfBounds due to swapped right/bottom difference r…
UweKubosch Aug 24, 2021
32ece77
Start testing in CI with Ruby 3.0.x
UweKubosch Aug 24, 2021
0ced5a6
Use Minitest::Assertion if avaliable
UweKubosch Sep 29, 2021
26ac722
Double quote string as per standard
UweKubosch Oct 3, 2021
bedb2f9
Added a better rspec usage section because the existing one doesn't w…
TechFounder Oct 19, 2021
cb964c4
Fix drawing of multiple skip_areas
UweKubosch Dec 8, 2021
d858127
Drops unsupported ruby and rails versions (#40)
pftg Jan 9, 2022
25466af
Reduce memory footprint SEVERELY by unreferencing completed comparisons
UweKubosch Jan 16, 2022
7080988
Allow requiring the entry point using the gem name with dashes. Fixe…
UweKubosch Feb 1, 2022
262f7d7
Change error reporting from raising to only storing the exception.
UweKubosch Feb 1, 2022
32ab315
Trigger tests on the master branch
UweKubosch Feb 1, 2022
e8de727
Skip window resize if screenshots are disabled
donv Mar 17, 2022
cd46fe3
Updates and Cleanups (#42)
pftg Apr 19, 2022
e2138c7
Added `crop` option to screenshot
UweKubosch Apr 22, 2022
1f24b7e
Avoid calculating the shoft distance if it is not requested
UweKubosch Apr 25, 2022
bf6955b
Raise ASSERTION if the failures array is not present.
UweKubosch May 10, 2022
0b30125
undefined local variable or method `failures' with RSpec 3.11.0 (#44)
pftg May 10, 2022
2792e66
Remove the tolerance default for chunky_png driver
UweKubosch Jun 21, 2022
b0831e7
Bump to version 1.6.3 for release
UweKubosch Jun 21, 2022
49ffc9d
Allows to provide css selectors for skip_area and crop arguments
pftg Jul 8, 2022
9bb4057
Bump actions/checkout from 2 to 3
dependabot[bot] Sep 19, 2022
dfac129
Fixed typo in README
pftg Sep 23, 2022
4b83627
Allow skipping stack frames in the failure report
UweKubosch Sep 27, 2022
1b2a1c0
Version 1.7: Require Ruby 2.7+ and Rails 6.0+
UweKubosch Sep 27, 2022
d80f8a7
Allow Ruby 2.6 until JRuby 9.4 is released
UweKubosch Sep 27, 2022
70f28e8
Exclude tests for JRuby + Rails 7.0 since Ruby 2.7+ is required
UweKubosch Sep 27, 2022
2449a73
Cleanup white space
UweKubosch Sep 27, 2022
90ad52d
Trigger GH Actions
UweKubosch Sep 27, 2022
e024391
Trigger GH Actions
UweKubosch Sep 27, 2022
705f0d0
Rename `take_screenshot` to `take_comparison_screenshot`
UweKubosch Oct 5, 2022
19e8ee3
Prevents runtime error with stability_time_limit (#51)
pftg Oct 14, 2022
4fc5f72
Fixes test for cuprite capybara driver (#55)
pftg Nov 12, 2022
0e2ab1c
Fixes calculation of the difference level for ChunkyPNG (#53)
pftg Nov 21, 2022
8f94495
Makes sure that options has Region only (#54)
pftg Nov 21, 2022
922d6a6
Adds RBS signatures to help IDE to find usages and potential errors (…
pftg Nov 22, 2022
d8545a8
Fixes typo
pftg Nov 22, 2022
a708e7e
Added more types and cleanup some parts (#58)
pftg Nov 25, 2022
227805a
Tunings CI (#57)
pftg Nov 30, 2022
952c7cc
Hotfix: does not skip create new screenshots
pftg Dec 22, 2022
47d1c0c
Allows to use latest chunky_png for development (#61)
pftg Dec 23, 2022
303f8cb
Adds Benchmark and Tests tunings (#62)
pftg Jan 9, 2023
95751e7
Only show the retina resize warning once, but add the before and afte…
UweKubosch Jan 24, 2023
217c00d
Draw skip areas only on the actual area and after the difference rect…
donv Feb 2, 2023
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
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
12 changes: 12 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.github/
.ruby-lsp/
coverage/
tmp/

# Ignore report files
*.attempt_*.png
*.diff.png
*.base.png
*.attempt_*.webp
*.diff.webp
*.base.webp
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
40 changes: 40 additions & 0 deletions .github/actions/setup-ruby-and-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
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

- run: sudo apt-get -qq update
shell: bash

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

# fallback if cache version is outdated
- run: sudo apt-get -qq install libvips
shell: bash

- run: sudo sed -i 's/true/false/g' /etc/fonts/conf.d/10-yes-antialias.conf
shell: bash
23 changes: 23 additions & 0 deletions .github/actions/upload-screenshots/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: 'Upload screenshots for debug'
description: 'To reproduce the issue locally, download the screenshots from the failed test'
inputs:
name:
description: 'Customize the name of the artifact'
required: true
runs:
using: 'composite'
steps:
- uses: actions/upload-artifact@v4
with:
name: ${{ inputs.name }}-diffs
retention-days: 1
path: |
test/fixtures/app/doc/screenshots/

- uses: actions/upload-artifact@v4
with:
name: ${{ inputs.name }}-capybara-fails
retention-days: 1
path: |
tmp/capybara/screenshots-diffs/
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"
37 changes: 37 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
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

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

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
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 ./
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
on:
workflow_dispatch:

jobs:
push:
name: Push gem to RubyGems.org
runs-on: ubuntu-latest

permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
contents: write # IMPORTANT: this permission is required for `rake release` to push the release tag

steps:
# Set up
- uses: actions/checkout@v5
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: ruby

# Release
- uses: rubygems/release-gem@v1
188 changes: 188 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
---

name: Test

on:
push:
branches: [ master ]
pull_request:
type: [ opened, synchronize, reopened, review_requested ]
paths:
- '**.gemfile'
- '**.rb'
- '.github/workflows/**'
- '!bin/**'
workflow_dispatch:

env:
BUNDLE_GEMFILE: gemfiles/rails80_gems.rb
DEBIAN_FRONTEND: noninteractive
FERRUM_PROCESS_TIMEOUT: 40
JAVA_OPTS: -Xmn2g -Xms6g -Xmx6g -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m -Xss1m
-XX:+UseG1GC -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:ReservedCodeCacheSize=256m
-XX:+UseCodeCacheFlushing
JRUBY_OPTS: --dev -J-Djruby.thread.pool.enabled=true
MALLOC_ARENA_MAX: 2
RUBY_GC_HEAP_FREE_SLOTS: 600000
RUBY_GC_HEAP_GROWTH_FACTOR: 1.1
RUBY_YJIT_ENABLE: 1

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
# Test that new contributors can run the tests directly after checkout.
test-minimal-setup:
name: Test with minimal setup
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v5

- uses: ./.github/actions/setup-ruby-and-dependencies
with:
ruby-version: 3.4

- run: bin/rake test
env:
SCREENSHOT_DRIVER: vips

functional-test:
name: Functional Test
runs-on: ubuntu-latest
timeout-minutes: 5

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

- uses: ./.github/actions/setup-ruby-and-dependencies
with:
ruby-version: 3.4
cache-apt-packages: true

- run: bin/rake test
env:
COVERAGE: enabled
DISABLE_SKIP_TESTS: 1
SCREENSHOT_DRIVER: vips

- uses: ./.github/actions/upload-screenshots
if: failure()
with:
name: base-screenshots

- name: Uploading Coverage Report
uses: actions/upload-artifact@v4
with:
name: coverage
retention-days: 1
path: coverage

matrix:
name: Test Ruby & Rails
# Test on master, when a review is requested or manually invoked.
if: >
github.ref == 'refs/heads/master' ||
github.event_name == 'workflow_dispatch' ||
github.event.pull_request.requested_reviewers.length > 0
needs: [ functional-test ]
runs-on: ubuntu-latest
timeout-minutes: ${{ contains(matrix.ruby-version, 'jruby') && 20 || 8 }}
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
ruby-version: [ 3.4, 3.3, 3.2, jruby-9.4, jruby-10.0 ]
gemfile:
- rails71_gems.rb
- rails72_gems.rb
- rails80_gems.rb
- rails81_gems.rb
experimental: [ false ]
exclude:
# We already tested last version
- ruby-version: 3.4
gemfile: rails80_gems.rb
experimental: false
# JRuby 9.x is Ruby 3.1 compatible, and Rails 8 requires Ruby 3.2.
- ruby-version: jruby-9.4
gemfile: rails80_gems.rb
experimental: false
- ruby-version: jruby-9.4
gemfile: rails81_gems.rb
experimental: false
include:
- ruby-version: 3.5.0-preview1
gemfile: rails81_gems.rb
experimental: true
- ruby-version: 3.5.0-preview1
gemfile: edge_gems.rb
experimental: true
- ruby-version: 3.4
gemfile: edge_gems.rb
experimental: true
- ruby-version: jruby-head
gemfile: rails80_gems.rb
experimental: true

env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}

steps:
- uses: actions/checkout@v5

- uses: ./.github/actions/setup-ruby-and-dependencies
with:
ruby-version: ${{ matrix.ruby-version }}
ruby-cache-version: ${{ matrix.ruby-version }}-${{ matrix.gemfile }}-1
cache-apt-packages: true

- name: Run tests (with 2 retries)
uses: nick-fields/retry@v3
with:
timeout_minutes: ${{ contains(matrix.ruby-version, 'jruby') && 7 || 3 }}
max_attempts: 3
command: bin/rake test

matrix-screenshot-driver:
name: Test Drivers
if: >
github.ref == 'refs/heads/master' ||
github.event.inputs ||
github.event_name == 'workflow_dispatch' ||
github.event.pull_request.requested_reviewers.length > 0
needs: [ 'functional-test' ]

strategy:
matrix:
capybara-driver: [ selenium_headless, selenium_chrome_headless, cuprite ]
screenshot-driver: [ vips, chunky_png ]

runs-on: ubuntu-latest

timeout-minutes: 5

steps:
- uses: actions/checkout@v5

- uses: ./.github/actions/setup-ruby-and-dependencies
with:
ruby-version: 3.4
cache-apt-packages: ${{ matrix.screenshot-driver == 'vips' }}

- name: Cache Selenium
uses: actions/cache@v4
with:
path: ~/.cache/selenium
key: ${{ runner.os }}-selenium-${{ matrix.capybara-driver }}

- run: bin/rake test:integration
env:
CAPYBARA_DRIVER: ${{ matrix.capybara-driver }}
SCREENSHOT_DRIVER: ${{ matrix.screenshot-driver }}

- uses: ./.github/actions/upload-screenshots
if: always()
with:
name: screenshots-${{ matrix.capybara-driver }}-${{ matrix.screenshot-driver }}
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
*~
/.bundle/
/.idea
/.windsurf
/.yardoc
/Gemfile.lock
/_yardoc/
/coverage/
/doc/
/gemfiles/*.lock
/gems.locked
/pkg/
/spec/reports/
/tmp/
/vendor/sigs/

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

*.attempt_*.webp
*.diff.webp
*.base.webp
Loading