mirror of
https://github.com/GTNewHorizons/GTNH-Actions-Workflows.git
synced 2025-10-13 21:01:19 +02:00
Add a sanity check to build-and-test workflow to prevent overzealous asset file optimizations (#51)
This commit is contained in:
parent
9a64d69ca0
commit
7efb286761
18
.github/workflows/build-and-test.yml
vendored
18
.github/workflows/build-and-test.yml
vendored
@ -135,3 +135,21 @@ jobs:
|
|||||||
- name: Test no prerelease dependencies used
|
- name: Test no prerelease dependencies used
|
||||||
run: |
|
run: |
|
||||||
! grep -P -- "-pre(?!shadow)" dependencies.gradle*
|
! grep -P -- "-pre(?!shadow)" dependencies.gradle*
|
||||||
|
|
||||||
|
# See https://github.com/GTNewHorizons/GT5-Unofficial/pull/4880
|
||||||
|
- name: Make sure asset files are not overoptimized
|
||||||
|
run: |
|
||||||
|
echo "Checking for grayscale asset files which are not supported by the java8 image loader"
|
||||||
|
fail=0
|
||||||
|
set -o pipefail
|
||||||
|
while IFS= read -r -d $'\n' file; do
|
||||||
|
if $(file --brief -- "$file" | grep -q grayscale); then
|
||||||
|
printf "found grayscale image '%s'\n" "$file"
|
||||||
|
fail=1
|
||||||
|
fi
|
||||||
|
done < <(gh pr diff --name-only "${PR_NUMBER}" | grep 'src/main/resources/.*\.png$')
|
||||||
|
|
||||||
|
exit $fail
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
PR_NUMBER: ${{ github.event.number }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user