Skip to content

Commit d325487

Browse files
Merge pull request #289 from ClojureCivitas/column-combos
first attempt at incremental build
2 parents df7c470 + b34234b commit d325487

File tree

2 files changed

+46
-4
lines changed

2 files changed

+46
-4
lines changed

.github/workflows/render-and-publish.yml

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,32 @@ jobs:
1515
steps:
1616
- name: Check out repository
1717
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0 # need history for diffing against main
20+
21+
- name: Download previous Pages artifact (optional cache)
22+
if: github.event_name == 'push'
23+
env:
24+
GH_TOKEN: ${{ github.token }}
25+
REPO: ${{ github.repository }}
26+
run: |
27+
set -euo pipefail
28+
mkdir -p site/_site
29+
latest_run=$(gh api "/repos/$REPO/actions/workflows/render-and-publish.yml/runs?branch=main&status=success&per_page=1" --jq '.workflow_runs[0].id' || true)
30+
if [ -z "${latest_run:-}" ]; then
31+
echo "No successful main run found; skipping artifact download."
32+
exit 0
33+
fi
34+
artifact_id=$(gh api "/repos/$REPO/actions/runs/$latest_run/artifacts" --jq '.artifacts[] | select(.name=="github-pages") | .id' | head -n1 || true)
35+
if [ -z "${artifact_id:-}" ]; then
36+
echo "No github-pages artifact found on latest main run; skipping download."
37+
exit 0
38+
fi
39+
echo "Downloading Pages artifact from run $latest_run (artifact $artifact_id)."
40+
gh api "/repos/$REPO/actions/artifacts/$artifact_id/zip" > /tmp/pages.zip
41+
unzip -q /tmp/pages.zip -d site/_site
42+
echo "Contents of site/_site after artifact unzip:"
43+
ls -la site/_site | head -50
1844
1945
- name: Set up Python
2046
uses: actions/setup-python@v5
@@ -45,8 +71,24 @@ jobs:
4571
key: cljdeps-${{ hashFiles('deps.edn') }}
4672
restore-keys: cljdeps-
4773

48-
- name: Build the content notebooks
49-
run: clojure -M:clay -A:markdown
74+
- name: Detect changed Clojure sources
75+
if: github.event_name == 'push'
76+
id: changed_clj
77+
run: |
78+
set -euo pipefail
79+
git fetch origin main:refs/remotes/origin/main
80+
changed=$(git diff --name-only --diff-filter=ACMR origin/main...HEAD -- 'src/**/*.clj' | tr '\n' ' ')
81+
if [ -z "$changed" ]; then
82+
echo "No changed Clojure sources detected."
83+
echo "files=" >> "$GITHUB_OUTPUT"
84+
exit 0
85+
fi
86+
echo "Changed Clojure source files:" $changed
87+
# space-separated for easy reuse
88+
echo "files=$changed" >> "$GITHUB_OUTPUT"
89+
90+
- name: Build notebooks (changed set or full when none)
91+
run: clojure -M:clay -A:markdown ${{ steps.changed_clj.outputs.files }}
5092

5193
- name: Set up Quarto
5294
uses: quarto-dev/quarto-actions/setup@v2

src/data_visualization/aog/column_combinations.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
:date "2026-01-011"
77
:description "Can we plot interesting charts for all columns of a dataset?"
88
:category :data-visualization
9-
:tags [:datavis :algebra]
10-
:keywords [:datavis :composition :operators]}}}
9+
:tags [:datavis]
10+
:keywords [:datavis]}}}
1111
(ns data-visualization.aog.column-combinations
1212
(:require
1313
[clojure.string :as str]

0 commit comments

Comments
 (0)