diff --git a/.ci/install.sh b/.ci/install.sh index 3913a21513c..e4739eb2f56 100755 --- a/.ci/install.sh +++ b/.ci/install.sh @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1519feba055..9d9ee90005c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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') diff --git a/depends/install_imagequant.sh b/depends/install_imagequant.sh index b7cebbdbf60..2d2460b61f8 100755 --- a/depends/install_imagequant.sh +++ b/depends/install_imagequant.sh @@ -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/