Skip to content

Commit

Permalink
Cache libimagequant
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Jan 20, 2024
1 parent dd125c2 commit f9b9008
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .ci/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ if [[ $(uname) != CYGWIN* ]]; then
pushd depends && time ./install_webp.sh && popd

# libimagequant
pushd depends && time ./install_imagequant.sh && popd
if [[ "$GHA_LIBIMAGEQUANT_CACHE_HIT" != "true" ]]; then
pushd depends && time ./install_imagequant.sh && popd
fi

# raqm
pushd depends && time ./install_raqm.sh && popd
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,25 @@ jobs:
sway
wl-clipboard
- name: Cache libimagequant
if: startsWith(matrix.os, 'ubuntu')
uses: actions/cache@v4
id: cache-libimagequant
with:
path: |
/usr/include/libimagequant.h
/usr/lib/libimagequant.so*
key: ${{ runner.os }}-libimagequant-${{ hashFiles('/usr/include/libimagequant.h') }}-${{ hashFiles('/usr/lib/libimagequant.so*') }}
restore-keys: |
${{ runner.os }}-libimagequant-
- name: Install Linux dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
.ci/install.sh
env:
GHA_PYTHON_VERSION: ${{ matrix.python-version }}
GHA_LIBIMAGEQUANT_CACHE_HIT: ${{ steps.cache-libimagequant.outputs.cache-hit }}

- name: Install macOS dependencies
if: startsWith(matrix.os, 'macOS')
Expand Down
4 changes: 2 additions & 2 deletions depends/install_imagequant.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ archive=libimagequant-4.2.2

pushd $archive/imagequant-sys

cargo install cargo-c
cargo cinstall --prefix=/usr --destdir=.
time cargo install cargo-c
time cargo cinstall --prefix=/usr --destdir=.
sudo cp usr/lib/libimagequant.so* /usr/lib/
sudo cp usr/include/libimagequant.h /usr/include/

Expand Down

0 comments on commit f9b9008

Please sign in to comment.