mirror of
https://github.com/koreader/koreader
synced 2024-10-31 21:20:20 +00:00
CircleCI cache fix (#3329)
* Update luarocks/shellcheck/shfmt check based on `deps-{{ arch }}-{{ checksum ".ci/install.sh" }}` * We generate a git-rev-base to check whether we can trust the cache with `build-{{ arch }}-{{ checksum "git-rev-base" }}` Binary dependencies require `{{ arch }}` because there are different CPUs used on the servers. More information here: https://discuss.circleci.com/t/use-the-arch-cache-template-key-if-you-rely-on-cached-compiled-binary-dependencies/16129
This commit is contained in:
parent
66e521f34b
commit
91f07b9d99
@ -13,7 +13,7 @@ ls
|
||||
# if [ "$(git status --ignore-submodules=dirty --porcelain)" ]; then
|
||||
# "--ignore-submodules=dirty", removed temporarily, as it did not notice as
|
||||
# expected that base was updated and kept using old cached base
|
||||
if [ "$(git status --porcelain)" ]; then
|
||||
if [ "$(git status --ignore-submodules=dirty --porcelain)" ]; then
|
||||
# what changed?
|
||||
git status
|
||||
# purge and reinit submodules
|
||||
|
@ -11,10 +11,16 @@ jobs:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
keys:
|
||||
- deps
|
||||
- build
|
||||
# binary dependencies require {{ arch }} because there are different CPUs in use on the servers
|
||||
- deps-{{ arch }}-{{ checksum ".ci/install.sh" }}
|
||||
# need to init some stuff first or git will complain when sticking in base cache
|
||||
- run: git submodule init base && git submodule update base && pushd base && git submodule init && git submodule update && popd
|
||||
# we can't use command output directly for cache check so we write it to git-rev-base
|
||||
- run: pushd base && git_rev_base=$(git describe HEAD) && popd && echo $git_rev_base && echo $git_rev_base >git-rev-base
|
||||
- restore_cache:
|
||||
keys:
|
||||
- build-{{ arch }}-{{ checksum "git-rev-base" }}
|
||||
- run: echo 'export PATH=${HOME}/bin:${PATH}' >> $BASH_ENV
|
||||
|
||||
- run:
|
||||
name: setup
|
||||
command: .ci/before_install.sh
|
||||
@ -41,12 +47,12 @@ jobs:
|
||||
name: clean up cache
|
||||
command: rm -frv ./base/build/*/{spec,cache/*}
|
||||
- save_cache:
|
||||
key: build
|
||||
key: build-{{ arch }}-{{ checksum "git-rev-base" }}
|
||||
paths:
|
||||
- "/home/ko/.ccache"
|
||||
- "base"
|
||||
- save_cache:
|
||||
key: deps
|
||||
key: deps-{{ arch }}-{{ checksum ".ci/install.sh" }}
|
||||
paths:
|
||||
- "/home/ko/bin"
|
||||
- "/home/ko/.luarocks"
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -17,6 +17,7 @@ install/
|
||||
spec/unit/data
|
||||
doc/html
|
||||
git-rev
|
||||
git-rev-base
|
||||
emu
|
||||
luacov.stats.out
|
||||
trace-out.txt
|
||||
|
2
base
2
base
@ -1 +1 @@
|
||||
Subproject commit 2148066d59205f09d60f0bbaad256526b4b309d7
|
||||
Subproject commit a7b3508f9ffefe062db78a4797119041e24058c3
|
Loading…
Reference in New Issue
Block a user