summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorNick Pope <nick@nickpope.me.uk>2024-05-01 09:46:19 +0100
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2024-05-10 10:37:56 +0200
commit02c2090dc0e0b25e26fd3bb7dd7c1e4e12b17c59 (patch)
treec7689080fba7edb799ce67616c872b28a0d3a324 /.github
parent956f6610ec6fe08f0bfe000b3f722caa273e104d (diff)
Optimized images in the screenshots workflow.
Running `oxipng` over a set of screenshots from a previous run that were 1.9M in size resulted in a total size of 1.3M, a 31.5% reduction. This can be useful to reduce the artifact size stored in GitHub and locally if downloading screenshots from multiple runs. See https://til.simonwillison.net/github-actions/oxipng
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/screenshots.yml12
1 files changed, 12 insertions, 0 deletions
diff --git a/.github/workflows/screenshots.yml b/.github/workflows/screenshots.yml
index 7714f99710..f9f372102d 100644
--- a/.github/workflows/screenshots.yml
+++ b/.github/workflows/screenshots.yml
@@ -35,6 +35,18 @@ jobs:
working-directory: ./tests/
run: python -Wall runtests.py --verbosity=2 --noinput --selenium=chrome --headless --screenshots --settings=test_sqlite --parallel=2
+ - name: Cache oxipng
+ uses: actions/cache@v4
+ with:
+ path: ~/.cargo/
+ key: ${{ runner.os }}-cargo
+
+ - name: Install oxipng
+ run: which oxipng || cargo install oxipng
+
+ - name: Optimize screenshots
+ run: oxipng --interlace=0 --opt=4 --strip=safe tests/screenshots/*.png
+
- name: Upload screenshots
uses: actions/upload-artifact@v4
with: