Skip to content

Commit 1e0bfa1

Browse files
abdurrahman-ledgercunhabruno
authored andcommitted
ci: compress png file
1 parent 15ea877 commit 1e0bfa1

File tree

1 file changed

+21
-0
lines changed
  • tools/actions/composites/upload-allure-report

1 file changed

+21
-0
lines changed

tools/actions/composites/upload-allure-report/action.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,27 @@ runs:
4040
PATH_VALUE="${BRANCH}-${SUFFIX}"
4141
fi
4242
echo "path=${PATH_VALUE}" >> "$GITHUB_OUTPUT"
43+
- name: Compress PNG files
44+
shell: bash
45+
run: |
46+
if command -v pngquant &> /dev/null; then
47+
echo "pngquant already installed"
48+
else
49+
echo "Installing pngquant..."
50+
if [[ "$OSTYPE" == "darwin"* ]]; then
51+
brew install pngquant
52+
else
53+
sudo apt-get update && sudo apt-get install -y pngquant
54+
fi
55+
fi
56+
57+
PNG_COUNT=$(find "${{ inputs.path }}" -type f -name "*.png" 2>/dev/null | wc -l)
58+
echo "Found $PNG_COUNT PNG files to compress"
59+
60+
if [ "$PNG_COUNT" -gt 0 ]; then
61+
find "${{ inputs.path }}" -type f -name "*.png" -exec pngquant --quality=65-80 --skip-if-larger --ext .png --force {} \;
62+
echo "PNG compression completed"
63+
fi
4364
- name: Publish report on Allure Server
4465
id: publish-report
4566
uses: LedgerHQ/send-to-allure-server-action@2.1.2

0 commit comments

Comments
 (0)