Skip to content

Commit a05dede

Browse files
mmckyclaude
andauthored
ci: switch update-snapshots workflow to fixtures repo (prep for #390) (#392)
* ci: switch update-snapshots workflow to fixtures repo Lands the update-snapshots workflow change from #390 ahead of the rest of the migration. issue_comment triggers always run the workflow file from the default branch, so /update-new-snapshots on #390 was using the OLD (lecture-python-programming) workflow against the NEW (fixture-path) spec, producing 404-page screenshots. Merging this first lets #390's /update-new-snapshots run correctly: clone fixtures at FIXTURES_SHA, build them, run Playwright with the PR's spec, commit baselines back to the PR branch. This change is independent — it only affects /update-new-snapshots and /update-snapshots PR-comment workflows, not ci.yml or any per-PR run. ci.yml will follow in #390 along with the spec/tox/config changes that depend on it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ci: clarify "keep in sync with ci.yml" comment Per Copilot review: until #390 merges, ci.yml still builds lecture-python-programming and has no FIXTURES_SHA, so a "keep this in sync" cross-reference would send maintainers on a false trail. Reword to acknowledge the transitional state — references #390 and explains the sync becomes meaningful only after both workflows reference the fixtures repo. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 6a29b06 commit a05dede

1 file changed

Lines changed: 40 additions & 40 deletions

File tree

.github/workflows/update-snapshots.yml

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ on:
33
issue_comment:
44
types: [created]
55

6+
# Snapshots are generated against quantecon-book-theme-fixtures at this
7+
# pinned SHA. ci.yml will be migrated to the same fixtures repo in #390
8+
# (it still builds lecture-python-programming on main today); once that
9+
# lands, keep FIXTURES_SHA in sync between the two workflows.
10+
env:
11+
FIXTURES_REPO: QuantEcon/quantecon-book-theme-fixtures
12+
FIXTURES_SHA: d8ffc17c753ecf45fa25c6062827e1aa9de201b3
13+
614
jobs:
715
# /update-new-snapshots — only creates MISSING snapshots (safe for adding new tests)
816
update-new-snapshots:
@@ -33,31 +41,27 @@ jobs:
3341
ref: ${{ steps.pr.outputs.ref }}
3442
token: ${{ secrets.GITHUB_TOKEN }}
3543

36-
- name: Fetch lecture-python-programming
37-
shell: bash -l {0}
38-
run: |
39-
git clone --branch quantecon-book-theme https://github.com/QuantEcon/lecture-python-programming
44+
- name: Checkout fixtures
45+
uses: actions/checkout@v6
46+
with:
47+
repository: ${{ env.FIXTURES_REPO }}
48+
ref: ${{ env.FIXTURES_SHA }}
49+
path: fixtures
4050

41-
- name: Setup Anaconda
42-
uses: conda-incubator/setup-miniconda@v4
51+
- name: Setup Python
52+
uses: actions/setup-python@v6
4353
with:
44-
auto-update-conda: true
45-
auto-activate-base: true
46-
miniconda-version: 'latest'
4754
python-version: "3.13"
48-
environment-file: lecture-python-programming/environment.yml
49-
activate-environment: lecture-python-programming
55+
cache: "pip"
5056

51-
- name: Install quantecon-book-theme
52-
shell: bash -l {0}
57+
- name: Install fixtures build deps + this PR's theme
5358
run: |
54-
python -m pip install .
59+
pip install -r fixtures/requirements.txt
60+
pip install .
5561
56-
- name: Build HTML
57-
shell: bash -l {0}
58-
run: |
59-
cd lecture-python-programming
60-
jb build lectures --path-output ./
62+
- name: Build fixtures site
63+
working-directory: fixtures
64+
run: jb build . --warningiserror
6165

6266
- name: Setup Node.js
6367
uses: actions/setup-node@v6
@@ -74,7 +78,7 @@ jobs:
7478
continue-on-error: true
7579
run: npx playwright test --update-snapshots=missing
7680
env:
77-
SITE_PATH: lecture-python-programming/_build/html
81+
SITE_PATH: fixtures/_build/html
7882

7983
- name: Commit and Push Updated Snapshots
8084
run: |
@@ -140,31 +144,27 @@ jobs:
140144
ref: ${{ steps.pr.outputs.ref }}
141145
token: ${{ secrets.GITHUB_TOKEN }}
142146

143-
- name: Fetch lecture-python-programming
144-
shell: bash -l {0}
145-
run: |
146-
git clone --branch quantecon-book-theme https://github.com/QuantEcon/lecture-python-programming
147+
- name: Checkout fixtures
148+
uses: actions/checkout@v6
149+
with:
150+
repository: ${{ env.FIXTURES_REPO }}
151+
ref: ${{ env.FIXTURES_SHA }}
152+
path: fixtures
147153

148-
- name: Setup Anaconda
149-
uses: conda-incubator/setup-miniconda@v4
154+
- name: Setup Python
155+
uses: actions/setup-python@v6
150156
with:
151-
auto-update-conda: true
152-
auto-activate-base: true
153-
miniconda-version: 'latest'
154157
python-version: "3.13"
155-
environment-file: lecture-python-programming/environment.yml
156-
activate-environment: lecture-python-programming
158+
cache: "pip"
157159

158-
- name: Install quantecon-book-theme
159-
shell: bash -l {0}
160+
- name: Install fixtures build deps + this PR's theme
160161
run: |
161-
python -m pip install .
162+
pip install -r fixtures/requirements.txt
163+
pip install .
162164
163-
- name: Build HTML
164-
shell: bash -l {0}
165-
run: |
166-
cd lecture-python-programming
167-
jb build lectures --path-output ./
165+
- name: Build fixtures site
166+
working-directory: fixtures
167+
run: jb build . --warningiserror
168168

169169
- name: Setup Node.js
170170
uses: actions/setup-node@v6
@@ -181,7 +181,7 @@ jobs:
181181
continue-on-error: true
182182
run: npx playwright test --update-snapshots
183183
env:
184-
SITE_PATH: lecture-python-programming/_build/html
184+
SITE_PATH: fixtures/_build/html
185185

186186
- name: Upload Old vs New Diff
187187
uses: actions/upload-artifact@v7

0 commit comments

Comments
 (0)