@@ -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
0 commit comments