From 0cf90c4bc4945511182962079abce74c695e0b81 Mon Sep 17 00:00:00 2001 From: t1amak Date: Thu, 19 Mar 2026 14:08:39 +0100 Subject: [PATCH] Cache external submodules and depends in CI --- .gitea/workflows/build.yml | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 52fd71d..44dea78 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -43,8 +43,26 @@ jobs: - name: Checkout uses: https://github.com/actions/checkout@v4 with: - fetch-depth: 0 - submodules: recursive + fetch-depth: 1 + fetch-tags: true + submodules: false + + - name: Prepare submodule cache key + run: | + git submodule status --cached --recursive > .ci-submodules.lock + + - name: Restore external cache + id: cache-external + uses: https://github.com/actions/cache@v3 + with: + path: external + key: external-${{ hashFiles('.ci-submodules.lock') }} + + - name: Sync submodules + if: steps.cache-external.outputs.cache-hit != 'true' + run: | + git submodule sync --recursive + git submodule update --init --recursive --depth 1 - name: Install dependencies run: | @@ -65,6 +83,17 @@ jobs: zip \ ${{ matrix.toolchain.packages }} + - name: Restore depends cache + id: cache-depends + uses: https://github.com/actions/cache@v3 + with: + path: | + contrib/depends/built + contrib/depends/sources + contrib/depends/work/build + contrib/depends/${{ matrix.toolchain.host }} + key: depends-${{ matrix.toolchain.host }}-${{ hashFiles('contrib/depends/Makefile', 'contrib/depends/funcs.mk', 'contrib/depends/hosts/*.mk', 'contrib/depends/packages/*.mk', 'contrib/depends/toolchain.cmake.in') }} + - name: Prepare MinGW alternatives if: ${{ matrix.toolchain.host == 'x86_64-w64-mingw32' || matrix.toolchain.host == 'i686-w64-mingw32' }} run: |