diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2023-07-23 12:36:38 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2023-07-25 11:34:59 +0200 |
commit | 95a2d5b0449fcd38113c494fa8e7c4bbe7b24bf2 (patch) | |
tree | a799e769b92a57488e71ab124a204ad3293f17a4 /.github | |
parent | 0e0b396af4dcf739636995e7ece298597c219d2e (diff) | |
download | mpv-95a2d5b0449fcd38113c494fa8e7c4bbe7b24bf2.tar.bz2 mpv-95a2d5b0449fcd38113c494fa8e7c4bbe7b24bf2.tar.xz |
ci/mingw: use ccache
Can significantly reduce build time, most of dependencies have fixed
versions, so they can be cached fully. Others will be incrementally
build.
Cache is saved on every run and restored from the newest one. Size is
limited to 500M (compressed) to keep cache save/restore fast. Clean
cached build is little over 100M, so we have a headroom as things will
grow. ccache will automatically evict least recently used entries.
It is unlikely that clean build will exceed the limit anytime soon, but
it is something to keep in mind, as we do not want to evict cache
entries from current build, so the cache size need to be set correctly.
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/build.yml | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4a598241fd..406904b2e0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,10 @@ on: jobs: mingw: runs-on: ubuntu-22.04 + env: + CCACHE_BASEDIR: ${{ github.workspace }} + CCACHE_DIR: ${{ github.workspace }}/.ccache + CCACHE_MAXSIZE: 500M strategy: fail-fast: false matrix: @@ -19,11 +23,21 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Get time + id: get_time + run: echo "timestamp=`date +%s%N`" >> $GITHUB_OUTPUT + + - uses: actions/cache@v3 + with: + path: ${{ env.CCACHE_DIR }} + key: ${{ matrix.target }}-${{ steps.get_time.outputs.timestamp }} + restore-keys: ${{ matrix.target }}- + - name: Install dependencies run: | sudo dpkg --add-architecture i386 sudo apt-get update - sudo apt-get install -y autoconf automake pkg-config g++-mingw-w64 gcc-multilib python3-pip ninja-build nasm wine wine32 wine64 + sudo apt-get install -y autoconf automake pkg-config g++-mingw-w64 gcc-multilib python3-pip ninja-build nasm wine wine32 wine64 ccache sudo python3 -m pip install meson - name: Build libraries |