diff --git a/.github/workflows/build-template.yml b/.github/workflows/build-template.yml index f5e3f656ede1..75f5498bd7cb 100644 --- a/.github/workflows/build-template.yml +++ b/.github/workflows/build-template.yml @@ -131,7 +131,7 @@ jobs: else echo "TARGET_STAGE=stage1" >> $GITHUB_ENV fi - - name: Build + - name: Configure Build run: | ulimit -c unlimited # coredumps [ -d build ] || mkdir build @@ -168,6 +168,22 @@ jobs: fi # contortion to support empty OPTIONS with old macOS bash cmake .. --preset ${{ matrix.CMAKE_PRESET || 'release' }} -B . ${{ matrix.CMAKE_OPTIONS }} ${OPTIONS[@]+"${OPTIONS[@]}"} -DLEAN_INSTALL_PREFIX=$PWD/.. + - name: Build Stage 0 + run: | + ulimit -c unlimited # coredumps + cd build + time make stage0 -j$NPROC + - name: Download Lake Cache + if: matrix.name == 'Linux Lake (Cached)' + run: | + cd src + ../build/stage0/bin/lake cache get \ + --repo=${{ github.event.pull_request.head.repo.full_name || github.repository }} + continue-on-error: true + - name: Build Target Stage + run: | + ulimit -c unlimited # coredumps + cd build time make $TARGET_STAGE -j$NPROC # Should be done as early as possible and in particular *before* "Check rebootstrap" which # changes the state of stage1/ @@ -187,6 +203,19 @@ jobs: build/stage1/**/*.c build/stage1/**/*.c.o*' || '' }} key: ${{ steps.restore-cache.outputs.cache-primary-key }} + - name: Upload Lake Cache + # Caching on cancellation created some mysterious issues perhaps related to improper build + # shutdown + if: matrix.name == 'Linux Lake' && !cancelled() + run: | + cd src + ../build/stage0/bin/lake build -o build/lake-mappings.jsonl + ../build/stage0/bin/lake cache put build/lake-mappings.jsonl \ + --repo=${{ github.event.pull_request.head.repo.full_name || github.repository }} + env: + LAKE_CACHE_KEY: ${{ secrets.LAKE_CACHE_KEY }} + LAKE_ARTIFACT_ENDPOINT: ${{ secrets.LAKE_ARTIFACT_ENDPOINT }} + LAKE_REVISION_ENDPOINT: ${{ secrets.LAKE_REVISION_ENDPOINT }} - name: Install run: | make -C build/$TARGET_STAGE install diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d4ce117fcbf7..173d5fdfea80 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -200,8 +200,20 @@ jobs: "test": true, // NOTE: `test-speedcenter` currently seems to be broken on `ubuntu-latest` "test-speedcenter": large && level >= 2, - // made explicit until it can be assumed to have propagated to PRs - "CMAKE_OPTIONS": "-DUSE_LAKE=ON", + // `-DUSE_LAKE=ON` made explicit until it can be assumed to have propagated to PRs + "CMAKE_OPTIONS": "-DUSE_LAKE=ON -DUSE_LAKE_CACHE=ON", + }, + { + "name": "Linux Lake (Cached)", + "os": large ? "nscloud-ubuntu-22.04-amd64-8x16-with-cache" : "ubuntu-latest", + "enabled": true, + "check-rebootstrap": level >= 1, + "check-stage3": level >= 2, + "test": true, + "secondary": true, + // NOTE: `test-speedcenter` currently seems to be broken on `ubuntu-latest` + "test-speedcenter": large && level >= 2, + "CMAKE_OPTIONS": "-DUSE_LAKE=ON -DUSE_LAKE_CACHE=ON", }, { "name": "Linux Reldebug",