Skip to content

Commit e4ac0a4

Browse files
authored
Update cache is complete check (#224)
An additional cache case to consider.
1 parent c72b858 commit e4ac0a4

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

.github/workflows/lint.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,20 @@ jobs:
7878
working-directory: build
7979
run: |
8080
export CONAN_LLVM_GIT_CACHE="${{ runner.temp }}/llvm-project"
81-
build_requires=$(conan info .. -pr:h default -pr:b default --build=outdated 2>/dev/null)
82-
if [[ "$build_requires" == *"Outdated package!"* ]];
81+
conan info .. -pr:h default -pr:b default --build=outdated --json build_requires.json
82+
build_requires=$(cat build_requires.json)
83+
if [[ "$build_requires" == *"[]"* ]];
8384
then
84-
all_in_cache=false
85-
else
8685
all_in_cache=true
86+
else
87+
all_in_cache=false
8788
fi
8889
echo "all_in_cache=$all_in_cache" >> $GITHUB_OUTPUT
8990
echo "Conan build requires: $build_requires"
9091
echo "Conan cache is complete: $all_in_cache"
92+
# If we have a cache miss on 'main', clear the cache.
93+
# A dependency was updated, so we need to drop the old one
94+
# to prevent unbounded cache growth over time.
9195
- name: Conan install
9296
id: conan_install
9397
working-directory: build

.github/workflows/test.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,13 @@ jobs:
6262
working-directory: build
6363
run: |
6464
export CONAN_LLVM_GIT_CACHE="${{ runner.temp }}/llvm-project"
65-
build_requires=$(conan info .. -pr:h default -pr:b default --build=outdated 2>/dev/null)
66-
if [[ "$build_requires" == *"Outdated package!"* ]];
65+
conan info .. -pr:h default -pr:b default --build=outdated --json build_requires.json
66+
build_requires=$(cat build_requires.json)
67+
if [[ "$build_requires" == *"[]"* ]];
6768
then
68-
all_in_cache=false
69-
else
7069
all_in_cache=true
70+
else
71+
all_in_cache=false
7172
fi
7273
echo "all_in_cache=$all_in_cache" >> $GITHUB_OUTPUT
7374
echo "Conan build requires: $build_requires"

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
breathe
22
cmake>=3.23
3-
conan==1.59.0
3+
conan==1.62.0
44
Jinja2==3.0.3 # https://github.com/sphinx-doc/sphinx/issues/10291
55
lit>=12.0.0
66
markupsafe==2.0.1

0 commit comments

Comments
 (0)