From 412fbc7217fb0d92d76d1af9a1951a1bed17f3e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Sun, 15 Sep 2024 07:21:33 +0200 Subject: [PATCH] sccache --- .github/workflows/build.yml | 55 +++++++------------------------------ ci/build-mingw64.sh | 12 ++++---- 2 files changed, 16 insertions(+), 51 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4b3c879e2f13e..814af25329f49 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,9 +33,7 @@ jobs: mingw: runs-on: ubuntu-24.04 env: - CCACHE_BASEDIR: ${{ github.workspace }} - CCACHE_DIR: ${{ github.workspace }}/.ccache - CCACHE_MAXSIZE: 500M + SCCACHE_GHA_ENABLED: "on" strategy: fail-fast: false matrix: @@ -47,22 +45,14 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Get time - id: get_time - run: echo "timestamp=`date +%s%N`" >> $GITHUB_OUTPUT - - - name: Restore cache - uses: actions/cache/restore@v4 - with: - path: ${{ env.CCACHE_DIR }} - key: ${{ matrix.target }}-${{ steps.get_time.outputs.timestamp }} - restore-keys: ${{ matrix.target }}- + - name: Setup sccache + uses: mozilla-actions/sccache-action@v0.0.5 - name: Install dependencies run: | sudo dpkg --add-architecture i386 sudo apt-get update - sudo apt-get install -y ccache g++-mingw-w64 gcc-multilib meson nasm ninja-build pkg-config ${{ matrix.wine }} + sudo apt-get install -y g++-mingw-w64 gcc-multilib meson nasm ninja-build pkg-config ${{ matrix.wine }} - name: Install Meson Wraps run: | @@ -108,25 +98,16 @@ jobs: name: mpv-${{ matrix.target }} path: mpv-git-*.zip - - name: Save Cache - uses: actions/cache/save@v4 - if: always() - with: - path: ${{ env.CCACHE_DIR }} - key: ${{ matrix.target }}-${{ steps.get_time.outputs.timestamp }} - win32: runs-on: windows-latest env: VS: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise" - CC: "ccache clang" - CXX: "ccache clang++" + CC: "sccache clang" + CXX: "sccache clang++" CC_LD: "lld" CXX_LD: "lld" WINDRES: "llvm-rc" - CCACHE_BASEDIR: ${{ github.workspace }} - CCACHE_DIR: "${{ github.workspace }}\\.ccache" - CCACHE_MAXSIZE: 500M + SCCACHE_GHA_ENABLED: "on" steps: - name: Disable autocrlf run: | @@ -135,17 +116,8 @@ jobs: - uses: actions/checkout@v4 - - name: Get time - id: get_time - run: | - "timestamp=$((Get-Date).Ticks)" >> $env:GITHUB_OUTPUT - - - name: Restore cache - uses: actions/cache/restore@v4 - with: - path: ${{ env.CCACHE_DIR }} - key: x86_64-windows-msvc-${{ steps.get_time.outputs.timestamp }} - restore-keys: x86_64-windows-msvc- + - name: Setup sccache + uses: mozilla-actions/sccache-action@v0.0.5 # https://github.com/mesonbuild/meson/pull/11715 - name: Install dependencies @@ -154,7 +126,7 @@ jobs: python -m pip install build wheel python -m build --wheel --no-isolation meson python -m pip install (Get-Item ./meson/dist/meson-*-py3-none-any.whl).FullName - choco install ccache nasm + choco install nasm - name: Update Meson WrapDB run: | @@ -202,13 +174,6 @@ jobs: build/vulkan-*.dll !build/mpv.lib - - name: Save Cache - uses: actions/cache/save@v4 - if: always() - with: - path: ${{ env.CCACHE_DIR }} - key: x86_64-windows-msvc-${{ steps.get_time.outputs.timestamp }} - macos: runs-on: ${{ matrix.os }} strategy: diff --git a/ci/build-mingw64.sh b/ci/build-mingw64.sh index 34f5a702f4b88..8b0897fb47ae6 100755 --- a/ci/build-mingw64.sh +++ b/ci/build-mingw64.sh @@ -38,8 +38,8 @@ cat >"$prefix_dir/crossfile" <