Skip to content

Commit 54910b4

Browse files
committed
chore: use Lake remote cache in CI
1 parent efbbb0b commit 54910b4

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

.github/workflows/build-template.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ jobs:
102102
if: matrix.cmultilib
103103
- name: Restore Cache
104104
id: restore-cache
105+
if: matrix.name != 'Linux Lake (Cached)'
105106
uses: actions/cache/restore@v4
106107
with:
107108
# NOTE: must be in sync with `save` below and with `restore-cache` in `update-stage0.yml`
@@ -131,6 +132,10 @@ jobs:
131132
else
132133
echo "TARGET_STAGE=stage1" >> $GITHUB_ENV
133134
fi
135+
- name: Download Lake Cache
136+
if: matrix.name == 'Linux Lake (Cached)'
137+
run: lake cache get --repo=${{ github.event.pull_request.head.repo.full_name || github.repository }}
138+
continue-on-error: true
134139
- name: Build
135140
run: |
136141
ulimit -c unlimited # coredumps
@@ -187,6 +192,17 @@ jobs:
187192
build/stage1/**/*.c
188193
build/stage1/**/*.c.o*' || '' }}
189194
key: ${{ steps.restore-cache.outputs.cache-primary-key }}
195+
- name: Upload Lake Cache
196+
# Caching on cancellation created some mysterious issues perhaps related to improper build
197+
# shutdown
198+
if: matrix.name == 'Linux Lake' && !cancelled()
199+
run: |
200+
lake build -o build/lake-mappings.json
201+
lake cache put build/lake-mappings.json --repo=${{ github.event.pull_request.head.repo.full_name || github.repository }}
202+
env:
203+
LAKE_CACHE_KEY: ${{ secrets.LAKE_CACHE_KEY }}
204+
LAKE_ARTIFACT_ENDPOINT: ${{ secrets.LAKE_ARTIFACT_ENDPOINT }}
205+
LAKE_REVISION_ENDPOINT: ${{ secrets.LAKE_REVISION_ENDPOINT }}
190206
- name: Install
191207
run: |
192208
make -C build/$TARGET_STAGE install

.github/workflows/ci.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,20 @@ jobs:
200200
"test": true,
201201
// NOTE: `test-speedcenter` currently seems to be broken on `ubuntu-latest`
202202
"test-speedcenter": large && level >= 2,
203-
// made explicit until it can be assumed to have propagated to PRs
204-
"CMAKE_OPTIONS": "-DUSE_LAKE=ON",
203+
// `-DUSE_LAKE=ON` made explicit until it can be assumed to have propagated to PRs
204+
"CMAKE_OPTIONS": "-DUSE_LAKE=ON -DUSE_LAKE_CACHE=ON",
205+
},
206+
{
207+
"name": "Linux Lake (Cached)",
208+
"os": large ? "nscloud-ubuntu-22.04-amd64-8x16-with-cache" : "ubuntu-latest",
209+
"enabled": true,
210+
"check-rebootstrap": level >= 1,
211+
"check-stage3": level >= 2,
212+
"test": true,
213+
"secondary": true,
214+
// NOTE: `test-speedcenter` currently seems to be broken on `ubuntu-latest`
215+
"test-speedcenter": large && level >= 2,
216+
"CMAKE_OPTIONS": "-DUSE_LAKE=ON -DUSE_LAKE_CACHE=ON",
205217
},
206218
{
207219
"name": "Linux Reldebug",

0 commit comments

Comments
 (0)