From ba36c7784ac52a29e81a24e19d9c5c91102b7836 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Sat, 14 Sep 2024 06:58:32 -0400 Subject: [PATCH] ci: use jupyter cache in docs ci builds to speed up docs builds (#10128) --- .github/workflows/docs-preview.yml | 6 ++++++ .github/workflows/ibis-docs-main.yml | 14 ++++++++++++++ .github/workflows/ibis-docs-pr.yml | 6 ++++++ 3 files changed, 26 insertions(+) diff --git a/.github/workflows/docs-preview.yml b/.github/workflows/docs-preview.yml index 2473ef4964eb..dd8972e897df 100644 --- a/.github/workflows/docs-preview.yml +++ b/.github/workflows/docs-preview.yml @@ -70,6 +70,12 @@ jobs: done } | tee /tmp/comment + - name: restore cache of the previously rendered notebooks + uses: actions/cache/restore@v4 + with: + key: docs-${{ github.event.pull_request.base.sha }} + path: docs/**/.jupyter_cache + - name: build docs run: nix develop --ignore-environment --keep HOME -c just docs-build-all diff --git a/.github/workflows/ibis-docs-main.yml b/.github/workflows/ibis-docs-main.yml index 159ffa2581bf..9b9a41c73f87 100644 --- a/.github/workflows/ibis-docs-main.yml +++ b/.github/workflows/ibis-docs-main.yml @@ -34,6 +34,14 @@ jobs: - name: checkout uses: actions/checkout@v4 + - name: restore cache of the previously rendered notebooks + uses: actions/cache/restore@v4 + with: + # https://docs.github.com/en/webhooks/webhook-events-and-payloads#push + # > The SHA of the most recent commit on ref before the push. + key: docs-${{ github.event.push.before }} + path: docs/**/.jupyter_cache + - name: run doctests # keep HOME because duckdb (which we use for doctests) wants to use # that for extensions @@ -45,6 +53,12 @@ jobs: - name: build docs run: nix develop --ignore-environment --keep HOME -c just docs-render + - name: cache rendered notebooks + uses: actions/cache/save@v4 + with: + key: docs-${{ github.sha }} + path: docs/**/.jupyter_cache + - name: build jupyterlite run: nix develop --ignore-environment --keep HOME -c just build-jupyterlite diff --git a/.github/workflows/ibis-docs-pr.yml b/.github/workflows/ibis-docs-pr.yml index 5d65e96c7f31..94f566c1676a 100644 --- a/.github/workflows/ibis-docs-pr.yml +++ b/.github/workflows/ibis-docs-pr.yml @@ -36,6 +36,12 @@ jobs: - name: checkout uses: actions/checkout@v4 + - name: restore cache of the previously rendered notebooks + uses: actions/cache/restore@v4 + with: + key: docs-${{ github.event.pull_request.base.sha }} + path: docs/**/.jupyter_cache + - name: run doctest # keep HOME because duckdb (which we use for doctests) wants to use # that for extensions