Cache external submodules and depends in CI
This commit is contained in:
@@ -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: |
|
||||
|
||||
Reference in New Issue
Block a user