Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 8 additions & 1 deletion .github/actions/setup-ruby-and-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,16 @@ runs:
bundler-cache: true
cache-version: ${{ inputs.ruby-cache-version }}-v1

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

Comment on lines +25 to +27
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Optimize apt-get update execution

The apt update should only run when we're not using cached packages or when the cache miss occurs.

-    - run: sudo apt-get -qq update
-      shell: bash
+    - name: Update apt package lists
+      if: ${{ inputs.cache-apt-packages != 'true' }}
+      run: sudo apt-get -qq update
+      shell: bash
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- run: sudo apt-get -qq update
shell: bash
- name: Update apt package lists
if: ${{ inputs.cache-apt-packages != 'true' }}
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-v1
version: tests-v2

# fallback if cache version is outdated
- run: sudo apt-get -qq install libvips
shell: bash
Comment on lines +35 to +37
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Improve fallback installation reliability

The fallback installation should update package lists before installing to ensure we don't hit stale package versions.

     # fallback if cache version is outdated
-    - run: sudo apt-get -qq install libvips
+    - name: Fallback libvips installation
+      run: |
+        sudo apt-get -qq update
+        sudo apt-get -qq install libvips
       shell: bash
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# fallback if cache version is outdated
- run: sudo apt-get -qq install libvips
shell: bash
# fallback if cache version is outdated
- name: Fallback libvips installation
run: |
sudo apt-get -qq update
sudo apt-get -qq install libvips
shell: bash

9 changes: 7 additions & 2 deletions .github/actions/upload-screenshots/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ runs:
using: 'composite'
steps:
- uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ inputs.name }}
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/
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:


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

Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
/tmp/
/vendor/sigs/

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

*.attempt_*.webp
*.diff.webp
*.base.webp
2 changes: 1 addition & 1 deletion test/capybara/screenshot/diff_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def test_screenshot_section_is_prepended

test "screenshot" do
screenshot_group "screenshot"
screenshot "a"
assert_matches_screenshot "a"
end

test "succeed on screenshot diff when fail_on_difference is false" do
Expand Down
Binary file modified test/fixtures/app/doc/screenshots/linux/cuprite/index-cropped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/fixtures/app/doc/screenshots/linux/cuprite/index-vips.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/fixtures/app/doc/screenshots/linux/cuprite/index.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading