Skip to content

Commit 3d74066

Browse files
authored
ci: set CI_CACHE to runner.temp (#7485)
When building nim compiler we pass $CI_CACHE to scripts/build_nim.sh as the 4th argument but its not set anywhere. https://github.com/status-im/nimbus-build-system/blob/e6c2c9da39c2d368d9cf420ac22692e99715d22c/makefiles/targets.mk#L80-L88 This could be the reason for weird caching we have been seeing on runner-node-02-linux-01-eu-hel1 Explicitly setting $CI_CACHE to {{runner.temp}} ensure we use a fresh directory always so that we do not get a cached version of nim commit to build. https://github.com/status-im/nimbus-build-system/blob/e6c2c9da39c2d368d9cf420ac22692e99715d22c/scripts/build_nim.sh#L214
1 parent c3d2270 commit 3d74066

File tree

2 files changed

+24
-8
lines changed

2 files changed

+24
-8
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ jobs:
7373

7474
steps:
7575
- name: Fix nim cache conflicts
76-
run: echo "XDG_CACHE_HOME=${{ runner.temp }}/.cache" >> $GITHUB_ENV
76+
run: |
77+
echo "XDG_CACHE_HOME=${{ runner.temp }}/.nim-cache" >> $GITHUB_ENV
78+
echo "CI_CACHE=${{ runner.temp }}/.nbs-cache" >> $GITHUB_ENV
7779
7880
- name: Clean workspace (very aggressive)
7981
if: contains(matrix.builder, 'self-hosted')
@@ -216,7 +218,9 @@ jobs:
216218
runs-on: ['self-hosted','ubuntu-22.04']
217219
steps:
218220
- name: Fix nim cache conflicts
219-
run: echo "XDG_CACHE_HOME=${{ runner.temp }}/.cache" >> $GITHUB_ENV
221+
run: |
222+
echo "XDG_CACHE_HOME=${{ runner.temp }}/.nim-cache" >> $GITHUB_ENV
223+
echo "CI_CACHE=${{ runner.temp }}/.nbs-cache" >> $GITHUB_ENV
220224
221225
- name: Clean workspace (very aggressive)
222226
run: rm -rf "$GITHUB_WORKSPACE"/*

.github/workflows/nightly_build.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ jobs:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- name: Fix nim cache conflicts
25-
run: echo "XDG_CACHE_HOME=${{ runner.temp }}/.cache" >> $GITHUB_ENV
25+
run: |
26+
echo "XDG_CACHE_HOME=${{ runner.temp }}/.nim-cache" >> $GITHUB_ENV
27+
echo "CI_CACHE=${{ runner.temp }}/.nbs-cache" >> $GITHUB_ENV
2628
2729
- name: Checkout code
2830
uses: actions/checkout@v4
@@ -71,7 +73,9 @@ jobs:
7173
runs-on: ubuntu-latest
7274
steps:
7375
- name: Fix nim cache conflicts
74-
run: echo "XDG_CACHE_HOME=${{ runner.temp }}/.cache" >> $GITHUB_ENV
76+
run: |
77+
echo "XDG_CACHE_HOME=${{ runner.temp }}/.nim-cache" >> $GITHUB_ENV
78+
echo "CI_CACHE=${{ runner.temp }}/.nbs-cache" >> $GITHUB_ENV
7579
7680
- name: Install packages
7781
env:
@@ -128,7 +132,9 @@ jobs:
128132
runs-on: ubuntu-latest
129133
steps:
130134
- name: Fix nim cache conflicts
131-
run: echo "XDG_CACHE_HOME=${{ runner.temp }}/.cache" >> $GITHUB_ENV
135+
run: |
136+
echo "XDG_CACHE_HOME=${{ runner.temp }}/.nim-cache" >> $GITHUB_ENV
137+
echo "CI_CACHE=${{ runner.temp }}/.nbs-cache" >> $GITHUB_ENV
132138
133139
- name: Install packages
134140
env:
@@ -185,7 +191,9 @@ jobs:
185191
runs-on: ubuntu-latest
186192
steps:
187193
- name: Fix nim cache conflicts
188-
run: echo "XDG_CACHE_HOME=${{ runner.temp }}/.cache" >> $GITHUB_ENV
194+
run: |
195+
echo "XDG_CACHE_HOME=${{ runner.temp }}/.nim-cache" >> $GITHUB_ENV
196+
echo "CI_CACHE=${{ runner.temp }}/.nbs-cache" >> $GITHUB_ENV
189197
190198
- name: Checkout code
191199
uses: actions/checkout@v4
@@ -234,7 +242,9 @@ jobs:
234242
runs-on: ubuntu-latest
235243
steps:
236244
- name: Fix nim cache conflicts
237-
run: echo "XDG_CACHE_HOME=${{ runner.temp }}/.cache" >> $GITHUB_ENV
245+
run: |
246+
echo "XDG_CACHE_HOME=${{ runner.temp }}/.nim-cache" >> $GITHUB_ENV
247+
echo "CI_CACHE=${{ runner.temp }}/.nbs-cache" >> $GITHUB_ENV
238248
239249
- name: Checkout code
240250
uses: actions/checkout@v4
@@ -283,7 +293,9 @@ jobs:
283293
runs-on: ubuntu-latest
284294
steps:
285295
- name: Fix nim cache conflicts
286-
run: echo "XDG_CACHE_HOME=${{ runner.temp }}/.cache" >> $GITHUB_ENV
296+
run: |
297+
echo "XDG_CACHE_HOME=${{ runner.temp }}/.nim-cache" >> $GITHUB_ENV
298+
echo "CI_CACHE=${{ runner.temp }}/.nbs-cache" >> $GITHUB_ENV
287299
288300
- name: Checkout code
289301
uses: actions/checkout@v4

0 commit comments

Comments
 (0)