From 0c8c30a59877b64c3d2071634afa5f96dea8e7b5 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Wed, 27 Mar 2024 11:34:29 +0100 Subject: [PATCH] build: fix caching ffmpeg builds --- .github/workflows/build_macos.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_macos.yml b/.github/workflows/build_macos.yml index e503e8657..115f736ac 100644 --- a/.github/workflows/build_macos.yml +++ b/.github/workflows/build_macos.yml @@ -73,9 +73,9 @@ jobs: - name: "Build dependency: libsdl2 (universal)" run: sudo port -N install libsdl2 +universal - - name: "Cache dependency: ffmpeg (universal)" - id: cache-ffmpeg - uses: actions/cache@v3 + - name: "Restore cache dependency: ffmpeg (universal)" + id: restore-cache-ffmpeg + uses: actions/cache/restore@v3 with: key: ${{ runner.os }}-build-ffmpeg-${{ hashFiles('.github/workflows/build_macos.yml') }} path: | @@ -83,7 +83,7 @@ jobs: ${{ env.FFMPEG_INSTALL_TMP_X86_64 }} - name: "Build dependency: ffmpeg (universal)" - if: ${{ steps.cache-ffmpeg.outputs.cache-hit != 'true' }} + if: ${{ steps.restore-cache-ffmpeg.outputs.cache-hit != 'true' }} run: | # Install to separate staging paths for all architectures in # preparation for fusing universal libraries in a follow-up step. @@ -123,6 +123,16 @@ jobs: make -j$(sysctl -n hw.ncpu) sudo make install + - name: "Save cache dependency: ffmpeg (universal)" + id: save-cache-ffmpeg + if: always() + uses: actions/cache/save@v3 + with: + key: ${{ runner.os }}-build-ffmpeg-${{ hashFiles('.github/workflows/build_macos.yml') }} + path: | + ${{ env.FFMPEG_INSTALL_TMP_UNIVERSAL }} + ${{ env.FFMPEG_INSTALL_TMP_X86_64 }} + - name: "Build dependency: ffmpeg (fuse universal libraries)" run: | # Copy universal artefacts to the MacPorts install prefix.